I've inherited a project where the distinct id was set to be the user's email address, and for various reasons I'd like to change it to be our internal user id; what's a good way to do this and keep continuity between user profiles (i.e. avoid creating a second profile for every single user)?
For existing users who youâve already tracked with the old ID, if you have both their old ID and new ID, you can use the Merge Identities API to merge the ID clusters of the two IDs. Please note that the Merge is irreversible. Please make sure to test your merge script with a small batch of IDs before running for the entire batch of IDs.
I would recommend running this merge script for existing users first, as to prevent any profile selection issues. If you start tracking your existing users with the new ID that is not yet merged and set profile properties, this will create a new profile property with the new ID. When you run the merge, the Mixpanelâs algorithm does not merge the profiles. Because it does not know which profile to keep, it will choose one to pick. There is no way to pre-determine which profile it will keep.
Update your implementation to use the new ID upon identify(). This will start tracking the user with the new ID in your Mixpanel tracking. You can prepare this change ahead of time and push it to production once youâre done with the merging.
If between Step 1 and Step 2 you missed merging some IDs, I would recommend running the merge script for any remaining unmerged IDs. There might be some risk of the profile issue I mentioned above, but it will be much less than if you ran the merge script for all existing profiles AFTER updating your implementation.
I think the project is on a Legacy ID merge system, so I might need to use alias instead? I'm not sure...
Vlad S. I have the same problem (I also inherited a project where email is used as a distinct id) and would be curious to hear how you resolve it! đ Though for a different reason, I also get âtoo many distinctIDs mapped together, Max limit: 500â on my some of the identify calls đ