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?
The primary purpose of calling mixpanel. alias() is to connect a user's anonymous events from before a signup (or other identification) event with the post-signup activity on your site or in your app. You can simply identify existing users with the Mixpanel identify method.
In order to track a first-time user in Mixpanel, you will need to specify an event and property combination that designates a first time user. In general this would mean you attach a property to an event or set of events when a first-time user performs them.
What is Mixpanel? Mixpanel is a user analytics tool that allows you to track how users interact with your Internet-connected application. Data is sent from a user's device or your server to Mixpanel, where it can be analyzed in real-time to better identify trends and understand user behavior.
Sending Events Once you have the snippet in your page, you can track an event by calling mixpanel. track with the event name and properties. // Send a "Played song" event to Mixpanel // with a property "genre" mixpanel.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With