Spec: Alias

The alias method is used to merge two user identities, effectively connecting two sets of user data as one. This is an advanced method, but it is required to manage user identities successfully in some of our destinations.

Since this is our most advanced method we have added sections to each docs page for destinations that use it:

If you’re instrumenting a website, then the Anonymous ID is generated in the browser so you’ll want to call alias from the client-side. If you’re using a server-side session ID as the Anonymous ID, then you’ll want to alias from the server-side.

Here’s the corresponding Javascript event that would generate the above payload. If you’re using Segment’s Javascript library, we’ll automatically pass in the user’s anonymousId as previousId for you: