Question

Managing Distinct ID between non cross browser domain cookies

  • 31 January 2020
  • 1 reply
  • 159 views

Userlevel 1
Badge +2

We have two websites

  1. Manages authentication (identity pages ie sign-in, sign-up, reset password, etc)
  2. Our actual SaaS app

Scenario:

  • where we may have a user within the app on a distinct ID.
  • And another user, on the same browser, signs up.

Don't want to have the events of those two users linked together. So we've opt not to have cross-browser cookies to manage the state.

Question is:

  • A user goes to sign-up with a sdk-generated distinct_id, alias it to our userId.
  • It then sends the user to the app (starting with a sdk-generated distinct_id)
  • and we "identify" them to their userId

Would the identity page's sdk-generated distinct_id (off the aliased userId) -MAP- to the "identified" userId based off the app's sdk-generated distinct_id?

Thinking of having our sign up pages have a "reset" so that every user going to that page is deemed to start a new journey. Is that a good idea?


1 reply

Userlevel 1
Badge +2


Lin Yee Koh (Mixpanel)

Dec 17, 7:07 PM PST

Hi Jonathan,

Hope all is well! My name is Lin Yee from Mixpanel Support and I would be happy to review this with you.

It sounds like there are two websites, one for users to signup and the other is for users to log in and use the app. Is this correct?

For some background, when a user is "identify", if there is an entry for the distinct_id that has been identified on the device that the data is being sent under (meaning that is has been aliased) Mixpanel will record the data under the original distinct_id that it is mapped to. If it isn't previously aliased, Mixpanel will record it under this disitnct_id that is being sent.

With that in mind,
1. if user A signup comes to your website (with sdk-generated distinct_id say "456")
2. Upon signing up, you alias user A alias to a userId. (When alias is called, Mixpanel will create a mapping between the Mixpanel generated distinct_id, and your unique identifier. -- For example alias created is "userA")
3. When "sends the user to the app", identify is called, you're passing your identifier and Mixpanel will connect it with the original distinct_id.
(maps "userA" to "456")

Here is an example of a User Identification Flow to illustrate the above scenario.

If "reset" is called each time sign up page is loaded, it does work like "a new journey" since a new distinct_id is generated and that marks the start of the journey. Using alias and identify in combination allows you to link pre and post signup activities and let you track your users across sessions and devices.

I would like to point you to this article on Identity Management: Best Practices since it will explain mixpanel.alias() and mixpanel.identify() methods to you in greater details.

Also, if you haven't reviewed our other identity management resources, I strongly recommend learning about Alias and Identify - this quick video outlines our two methods that help link anonymous event data to a registered user, as well as manage your user identity across different devices. We have also a great training video on Mixpanel Implementation for Developers which I find extremely insightful!

Reply