Mixpanel anonymous user converts to identified user tracking

Jim Rubenstein picture Jim Rubenstein · May 23, 2012 · Viewed 14.7k times · Source

I'm adding Mixpanel to my web application and I'm curious about the "process" around what happens when a user transitions from "anonymous" (not logged in/registered) to "identified" (when they register / create an account on the site).

If a user comes in and is new to the site, they get an anonymous UUID (according to the documentation). The documentation also says that Mixpanel can not translate between IDs at this time.

Does this mean Mixpanel is incapable of handling the transition of a non-registered user to a registered user, and keep track of their events from before they became a registered/identified user?

If so, does anyone have experience with working around this? How'd you go about it?

Answer

loopj picture loopj · Dec 31, 2012

As of December 2012, you can now use the mixpanel.alias method call to alias two ids:

https://mixpanel.com/docs/integration-libraries/using-mixpanel-alias

From the above docs:

John comes to your website, example.com, for the first time. He is assigned a randomly generated ID (perhaps 123123) by Mixpanel. Everything he does is associated with that ID.

After clicking through a few pages, he successfully signs up. On the signup confirmation page, you call mixpanel.alias("[email protected]"). This doesn't actually change his ID - he is still being identified using the random ID we originally assigned him.

What it does do is add the ID "[email protected]" to a lookup table on our end. Whenever we see data for "[email protected]", we know to remap it to 123123, his original ID.

So, you can start calling mixpanel.identify("[email protected]") on all your pages, and your events, funnels, and retention will all continue to work perfectly.