I need help with connecting an existing user to the log in event I’m tracking. ID Merge is enabled for the project.
When I log in with a user, I always get two log in events in the Live View:
The sequence of Mixpanel calls in the code is
- track log in event (when user clicks on “Log in”)
- identify user with user id after authentication
According to the ID Merge notes this is the suggested sequence, and connecting the user after identification to the pre-auth event does occur as shown above. However, the second event at the bottom of the screenshot is a duplicate event.
How to prevent that?
Best answer by Muffaddal Qutbuddin
Ok yeah so in your case it does make sense to trigger login event before identify as it is not related to when user performances login action, actually login one time.
Anyways, your code looks good, are you sure the profile with distinct ids 84e. and 177e…, from the image, are of same user? because if you are passing the same user id on identification Mixpanel will merge the profiles.
Have you tried viewing both of the profiles in Mixpanel? there are cases when MP shows two profiles in user view and live view but once opened it shows one single profile.