I’m having some difficulties with updating my distinct_id using the identify() function using the node.js library.
Before tracking an event I am updating the identity using:
It appears the distinct Id is set correctly as I am subsequently logging the output of,
which I can confirm matches the user_id.
I then immediately track an event, however the distinct_id appearing in the live view is instead a long auto-generated distinct_id.
Has anyone encountered anything similar, or spot something fundamentally wrong with my implementation?
Best answer by stephanie
We currently do not have an official public React Native library at the moment (coming soon!). Not sure if you are referring to a this third-party react native library? If so, to be honest I am not familiar with this library and would not know how it works as my expertise is on Mixpanel’s libraries.
You are on the right path on passing your user_id through the identify call. Additionally, since you are setting your own user_id you now have to set the user_id to every event, this can be done by using super properties via the identify functions. I wanted to share our help article Assigning Your Own UniqueID to Users which talks in more details on how super properties can help manage your user_id when working with client-side libraries.
Let me know if this helps!