Me and my team have a problem implementing a code for tracking anonymous user's activity in our app.
When an anonymous user enter in app we attribute a Distinct ID to him and after he register we use the alias method to connect the ID to his email
The problem is when the user is connected and do the logout, we tried with two different ways but with no success:
The first one was reseting the session id when he logs out, but after he logs in again instead of connect to the same id or email, mixpanel creates another user in mixpanel with the same property and email, but with different ID. This is happening always, making a lot of different but equal users.
We though this happened because of the reseting method so we tried without it but the result was even worst. When the user logs out the id persist and if another user logs in the last will be registered as the first, being impossible to separate them without using some property (like email).
For login we are using the identify method with 'people' setted to true.
Therefore, we want to know how can we track the anonymous and logged user without lost his future tracking when he logs out. Also, will be great if we tracked the same user in all plataforms we have, we read and tried but we still not knowing how to do it properly.