Hi support. Quick question regarding anonymousID v...
# support
a
Hi support. Quick question regarding anonymousID vs userID. I'm using the React SDK on my website and we don't have an account feature. We call identify when a user enters their email address and add personal details as traits. However we also call identify on first initialise and we don't have any traits. It looks like Rudderstack SDK generates a UID userID which is different from the anonymousID UID, which then gets passed around as the userID through all the page and track events. Is this behaviour correct and expected in this scenario? Or should userId = anonymousID for sites that don't have their own UID?
h
Hi @alert-vegetable-59655, We do not have any React SDK. We do have ReactNative SDK. But I believe you are using our JS SDK here. Our JS SDK only generates the anonymousId(which is a UUID) not the userId. userId is provided by the user during the identify call. Those are meant to be different. If you want to set the anonymousId as the userId you can do so.
gratitude thank you 2
🙏 1