Is there a limit to how many times we can call "alias()"?

  • 13 February 2019
  • 1 reply

Userlevel 2
  • Frequent Contributor
  • 5 replies

I read the .alias() documentation but I am still a bit confused.

Assume a user has 5 different emails. Can we call .alias() 5 times to link all those emails under the same Mixpanel user profile? or can alias() be called only once?

1 reply

Userlevel 1

According to the documentation you referenced and the MixTape API docs, calling alias() more than once for a given user should only be done if you're creating a new alias.

"The best practice is to call alias() when a unique ID is first created for a user (e.g., when a user first registers for an account and provides an email address). alias() should never be called more than once for a given user, except to chain a newer ID to a previously new ID, as described above."

However, it looks like if you have the original id available you can add several aliases to the same original ID only. From the beginning of the api docs on alias...

"Multiple aliases can map to the same original ID, but not vice-versa."