About alias() and identify()

  • 21 February 2019
  • 1 reply


Hey there :)
I stumbled across a few questions about alias() and identify() and I was hoping you could possibly help me out.

1. A user(who has already signed up on another device) visits my page with a new device and performs a few events before eventually logging into the membersarea where I call identify().

What happens to the anonymous actions the user performed before logging in? Does the identify() call link those actions and merges them into one person or is mixpanel not tracking those events retroactively?

2. A user comes to my page, performs a few events and eventually decides to Sign up for the first time. In this case I call alias() so the previous anonymous actions get linked to this alias.

After he signs up he continues browsing through my page and after performing a few events he decides to purchase a product with a new email.

What am I supposed to do in this scenario?

Can I call alias again with the new email? Is it possible to link two alias to one distinct_id?

Thank you so much in advance for your help :)

1 reply


Hi @AlexVoit,

I might be able to partially answer your question about identify() based on our implementations to do something similar. As we understood identify() when implementing Mixpanel we implemented a good funnel to track users on the site and to embedded apps this way:

- We have the library initially loaded on all pages of our site and grab the mixpanel_distinct_id and set it to a variable

- When a user lands on a page that has an embedded app of ours that also loads mixpanel, we pass that mixpanel_distinct_id to the embedded app and then call identify(), this ties all of the previous events attached to the distinct_id before the embedded app was loaded to the new events that the user creates inside the embedded app.

You may get into a little bit of a chicken and the egg scenario if when you first load the embedded app and have a page view that occurs before the identify() ties the first mixpanel_distinct_id together so be careful!

Hope this at least helped a little!