How to avoid/merge duplicate user profiles

  • 19 August 2019
  • 2 replies

Userlevel 2

Hello everybody,

Our application is using MixPanel for tracking events and users in anonymous and authenticated modes from NodeJS server side (using We have a problem that I will very appreciate if you can help.

Here is our flow:

1. When a user (said John) visits our web => generate an ID as distinct_id (said "anonymous_1")

2. We track John's events and info via his "anonymous_1" distinct_id

3.When John registers, alias "anonymous_1" to his user ID (said "user_1"). Thence, all his events and info will re tracked under "user_1".

The problem is if John uses another browser/device as an anonymous user (profile anonymous_2 is generated), and doesn't login until he has to login to use a login-required feature.

In this case, alias anonymous_2 to user_1 doesn't work because we aliased anonymous_1 before. So even we use "user_1" distinct_id after he logged in, the "anonymous_2" profile is duplicated with "anonymous_1", and there no way to merge these profiles.

Required conditions:

- We need to keep profiles distinct.

- We need to view flows and funnels and user-base analytics, so we need "anonymous_1" and "anonymous_2" 's events under 1 user, no events should be lost from its user.

Any helps/opinions will be helpful and appreciated.

Thank you for your time.

2 replies

Userlevel 1

Hey @Tu Nguyen!

If I am understanding you correctly, it sounds like you are having trouble mapping back those anonymous events to the first distinct ID you set for your user to the second distinct ID that was generated from another browser? If so, I've noticed that this is actually a limitation of the product in terms of not being able to map all anonymous sessions to a known user.

Some suggestions I have to go around this would be to prompt your users log-in to your application as soon as possible by sending an in-app message that links them to log-in. Another suggestion (and something we currently do) would be to make your users log-in right away to your website to make sure you are not loosing any anonymous data. This is not ideal since this could skew our potential users from never logging in, but so far we are okay with the trade off since we are interested in seeing the overall timeline of our users.

Overall, I do think this is something that would be worth making an Idea for. Maybe noting to please make it easy map anonymous data from different devices to one user. I hope my suggestions has help!

Userlevel 2

Thank you for your confirmation and suggestions @fredl . I got your ideas. We're considering between the approach.
Thank you for your time and helps.