I am using MixPanel in a web-application built using Flask. When a new user gets to our landing page, they get an anonymous ID by MixPanel, and when they click our signup button they get send to Google to authenticate and back to our Python-code for signup. At signup, I would like to give the user an alias, so that I can track the user signup in a funnel.
The method for setting an alias in Python is: mp.alias(new_internal_id, original_anonymous_id)
But I do not have a clue about how to obtain the original_anonymous_id inside the Python script.
I think you need to find "distinct_id
" in the cookie of that user.
Since when a user comes to your site for the first time, by default our Mixpanel javascript library will assign this user a distinct ID. While the user is going about your site anonymously, this default distinct ID will handle their identity on your product. The distinct ID will be stored in the user's cookie. As long as the user comes back with the same cookie, even if he remains anonymous he will be tracked as a unique user.
Check this link for detail.