Search code examples
trackinguser-profilemixpanel

Mixpanel user tracking- track registred user from different device


I am using mixpanel user profile tracking.

1 : If a new user, say A , visit my site and go through some pages without sign-up. That time mixpanel is tracking events to a unknown profile. 2 : Then the user A, sign up in my site and placed an order.

That time mixpanel is tracking previous events and the events after sign up also to a the same profile. (mentioned in above point).

3 : Then the user comes to my site using his mobile, then he go through the pages without login

That time mixpanel track the events to different a profile.

4 : The user then logged in in his mobile and continue to place order.

Then the mixpanel track events after the login into the previous profile mentioned in the 1st and 2 nd step.

My problem is I would like to re-map the tracking done in the 3rd step also to the profile which is used to track in 1st and 2nd step


Solution

  • There are 2 routes

    1-) Queue anonymous events: the idea would be that instead of sending Mixpanel the events when the user is still anonymous, you save them either on the device (if it's a mobile app) or on your server. Then, when the user logs in, or creates the account, you can flush the stored events since now you know who the user is. As you might realize, the downside is that if the user never logs in or signs up, then the events are never sent (unless you build a mechanism in your server to flush them in that case).

    2-) You could so as you currently do, but when the person goes to step 4, and logs in, before changing the ID to the correct one, you could create a People profile with the anonymous ID, mark it with a flag that it's an orphaned profile, and save the correct ID for it. That way, you can schedule a task to look at those profiles every so often, export their events, and import them back with the correct ID. That would essentially duplicate the data for those events, but you would have the full history with the correct ID. You could also try to filter events based on the "orphaned" flag later on, but it does mean you will always have to have it mind.