Hi, we have recently integrated rudderstack for tr...
# support
b
Hi, we have recently integrated rudderstack for tracking events. In one of the cases
track
calls don't send the
userId
value, even though a successful
identify
and `page`has been made. In console I see the error
Copy code
[Storage] rl_user_id should be string
Now
rl_user_id
is one of the cookies which rudderstack uses for sending payload in event calls. But, while making the identify call we use a mobile number string only. Attaching screenshots of
identify, page and track calls
also the console error.
m
Hey There! 👋 Your message has been received by the RudderStack team. Our standard customer support hours are 9-6 PM EST, but we will forward this request to your Technical Account Manager, and they will get back to you shortly. Please use the thread for any additional comments.
b
image.png,image.png,image.png,image.png
m
Can you confirm which version of the SDK you are using?
We are checking if the typeof (userId) is a string and throwing this error. You may be saving a float as the userId in this case. https://github.com/rudderlabs/rudder-sdk-js/blob/8d134215d407ac7708f04211b42b2d5150a90e4a/packages/analytics-js-common/src/v1.1/utils/storage/storage.js#L129-L130
b
Using the JS SDK integration and the version I see in network calls is v: 2.46.0
Cookie value in
rl_user_id
is
Copy code
RudderEncrypt%3AU2FsdGVkX1%2BiHFI8Y8R4G5FCwHMukUouCC2Hj1dW228%3D
This is a production issue, would really appreciate some urgent support.
m
Can you provide the website url?
b
https://mybillbook.in/pricing-settings?source=settings
/pricing-settings
is the path where userId starts missing.
m
You seem to be loading multiple writeKeys on this page. Is this by design?
One is web-staging and the other is web-production.
b
Trying to see why is that happening, will that affect the tracking call
userId
?
m
It should right, if they are different domain, why should one domain have access to the userId you set in another domain.
But are they different domains or is one a sub-domain of the other?
b
They are different domains, I am trying to see why the is the staging one running on production.
m
The team mentioned that you seem to be using both the CDN and NPM RudderStack packages. Also can you move to the new SDK v3 version?
b
Will moving to v3 fix something in this case? Also this is the staging(testing enviroment) url https://niobooks.in/webapp/pricing-settings?source=settings and even on this the issue exists. Is it because we are having two sourceConfig calls? Is this sourceConfig call due to the
rudderanalytics.load(key, url)
?
Also did you check the
rl_user_id
cookie value I sent?
m
Yes when you do a rudderanalytics.load(<writeKey>, <DataPlaneURL>) it makes a source config request to api.rudderlabs.com
The team mentioned that the rl_user_Id cookie error comes when you try to set a null value or empty object as the userId.
b
The issue was fixed, will put the information here in some time.
m
Oh ok. Thanks for the update.
b
After logging in the user, we were using two identify calls
Copy code
rudderanalyitics.identify(some_number)

//setting properties_object value

rudderanalyitics.identify(rudderanalyitics.getUserId(), properties_object)
Copy code
rudderanalyitics.getUserId()
returned undefined, putting it in a timeout call with 500ms delay, worked, but failed in some cases.
m
Oh ok. Thanks for the clarification.