Hi guys, I have a question about Identify (which I found this post but it didn't quite answer my question) What is best practice to merge user distinct ID when they log in? Using Google Tag Manager, I call "identify" on every page load with their email address - the thought being as soon as they log in on a new device, they will get tagged. I am getting this error for each event though "errAnonDistinctIdAssignedAlready", so understand this might not be best practice. Many thanks!
Thanks Bot, but it doesn't help with best practice unfortuantely
Hi Sebastian! Julianne from Mixpanel Support here.
Diving right in, the error message "errAnonDistinctIdAssignedAlready" typically occurs when you're trying to merge a Device ID that's already connected to a User ID to a different User ID. This happens when you call mixpanel.identify()
with a new User ID for a device that has already been identified with a different User ID. This is most often seen when multiple users are sharing one device.
The docs have examples of the user identification flow- you can see that here for Simplified ID Merge and here for Original ID Merge. Note, the ID Merge version is found in project settings.
Generally, the best practice would be to call identify() when the user logs in (rather than on every page load). If you expect multiple users to use one device, then you should also call reset() at logout. This will generate a new anonymous ID for the device.
I hope this helps! Let me know if you have any other questions.
Oh fantastic, thank you! So if I am understanding correctly;1. The error itself occuring isn't so much a problem; it would be expected to occur whenever the user logs in on a known device2. Best practice would be to hit the identify request when they first log in so we can match them up (new device) or receive this error (known device).3. Subsequent pageloads shouldn't include this identify request because it is unnecessary (but not necessarily problematic).4. Any of the other user properties set requests I assume follows the same logic, eg setting their name, phone etc - set it at login, not on every page. Am I on the right track? Thanks!To unsubscribe from this group and stop receiving emails from it, send an email to .
Received via email
Email text may have been truncated. Please review in Zendesk ticket.
Thanks for the response!
1. In general, I wouldn't expect to see this error since, if users share one device, then the recommendation would be to call reset() when a user logs out. Calling reset() would generate a new anonymous distinct ID for the device, so you would no longer see the error. If there are multiple users using one device and you're not calling reset(), it will generate the "errAnonDistinctIdAssignedAlready" error.
Do you expect multiple users to be accessing your platform on one device? If so, do you call reset() at logout?
2. Yes, the best practice would be to call identify() when a user logs in. This allows you to associate their activity with their User ID, whether they're on a new device or a known device.
3. Correct, you don't need to call identify()
on every page load. Once a user is identified (i.e., they've logged in), their User ID is stored and used for tracking their activity until they log out or until reset()
is called.
4. For setting user profile properties, you'd typically do this at account creation or when the user updates their profile property values. This function can be called multiple times, but it's best to call it when the properties are first known or when they change to avoid unnecessary calls.