In an actual received signal you will also have to address the frequency, phase and time offsets between the transmitter and receiver since they run off of independent clocks that aren’t otherwise synchronized, as well as frequency offsets introduced through Doppler if the transmitter and receiver are in motion relative to each other. Further information on the details of this can be found under the topics of Carrier Recovery and Timing Recovery.
For CDMA this can be done with a course frequency search by doing the OP’s correlation repeatably at different frequency offsets and using an acquisition threshold on the correlator output to determine the rough offset. Once within the acquisition bandwidth of the correlator (approximately 1/T where T is the duration of the PN sequence in time), the complex I Q outputs of the correlator can be used to measure phase change per correlation interval (which as $f=d \phi /dt$ is the fine frequency measurement (carrier offset). This approach can be part of a frequency lock loop or the individual phase measurements can be part of a phase lock loop; either being the carrier recovery implementation.
With CDMA one approach to timing and carrier recovery (common in GPS receivers) is to use three correlators each using the matching PN sequence separated by half a chip such that the correlator outputs form “Early”, “Prompt”, and “Late”. The prompt is used for carrier acquisition and tracking as described above by both sweeping frequency for carrier offset and the PN code for delay offset (at each frequency test). Once acquired, the early and late can maintain tracking (time offset) by subtracting the two (zero time error when early minus late equals zero).
I have other posts detailing this further as well as timing recovery that I will add links here. The above approach is sequential so slow but minimizes resource requirements. One link I show also provides further details on a direct (one-shot) frequency and delay (PN offset) acquisition that would be relatively fast (can be completed on a single capture) when the processing resources allow.
See:
Early - late gate spread spectrum
High modulation index PSK - carrier recovery
QPSK constellation from baseband signal