alias after the fact?

  • 10 July 2019
  • 3 replies


Last month we had an issue with our `alias` call not working correctly, I have tried to fix this by manually finding the mixpanel `distinct_id` and attempting to `alias` it with new distinct id via the python package

However the un-authed events are not being aliased to the user account, am I going around this the wrong way?

3 replies


1. When passing in the distinct id in the python package it must be a string

2. From what I've seen the alias works after an event is sent to mixpanel by that user (Which I had to fake)


However now I'm getting duplicate user profiles?

Userlevel 4
Badge +3

Hi @dannyaziz-

On a high level, you will want to have your alias value pointing to the anonymous distinct_id of your user so that you can connect your users anonymous activity (un-authed) with their activity after they have logged in.

To avoid duplicate profiles you will need to keep the distinct_id on the server consistent for each user, and send it with each event, or create an alias (PHP/Python/Ruby) that always points back to that anonymous ID — For example, if you call alias() on a username when your user signs up, you will then call identify() on the username so the event points back to the value that you previously aliased.

This article describes how to manage your identity management with a server-side implementation and I think it would be the most helpful to you here.

To dig deeper into how Identity Management works, I would check out their video on identity management here and their identity management article.

We also have a whole host of identity management questions that have come up in Community, which you can see all under the identity_management topic here:

Let me know how it goes!