Hey - When utilizing a server sided implementation, in the example of Nest.js, what's the best recommended approach to handle distinct_id ? Currently setting a uuid as a cookie, however when a user switches devices, their data is different even though a $user_id is provided in our events like the docs recommend
Hi Brian- Julianne from Mixpanel Support here!
Diving right in, with server-side ID management, your server is responsible for generating IDs and maintaining ID persistence. The specific steps depend on the ID management version that you're project is on. You can confirm this in the project settings on the Identity Merge tab.
For Simplified ID Merge, you need to send an event that has both the uuid and $user_id on it in order to connect together the event streams.
For Original ID Merge, you need to send the $identify
event with the uuid and $user_id to connect together the event streams.
Without those actions, the anonymous uuid won't be linked to the known $user_id. Does that help clear it up? If not, can you share which ID management version your project is on and what steps you currently have (ie send $identify
) for the ID management?
Hi there, We currently utilize the suggested approach as per the example you guys provide with Python, setting a cookie with the UUID, however, once the user switches devices(i.e switching from browser to mobile) they receive a new session ID, and when we call track() with their $user_id new events are created, but not merged and associated with that user. Happy to provide some code snippets privately. Thanks.
It would definitely be helpful to have more information about the code and the behavior seen. Can you reach out directly to Support via our webform? This will allow private troubleshooting specific to your project. When you submit a ticket, it would be helpful if you included a brief overview of your ID management process, along with links to the user profiles that show the behavior described.Â