Our application is using MixPanel for tracking events and users in anonymous and authenticated modes from NodeJS server side (using https://www.npmjs.com/package/mixpanel). 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.
- 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.