Linking users across browsers

Your software
My Mautic version is: v4.4.10
My PHP version is: PHP Version 7.4.3-4ubuntu2.19
My Database type and version is: mariadb v10.3.38

Your problem
We’re looking to integrate Mautic into an existing web-app which supports user login. The plan is to:

  • Use a common base domain
  • Check for an mtc_id cookie in the web-app after login
  • If the cookie is present, record the Mautic user id and push name/email via API to Mautic
  • If the cookie is not present, and no Mautic user id is known, include mtc.js and pick up the cookie on next request
  • Whenever a user adjusts their subscription data in the web-app, also push that into Mautic

That should ensure every web-app user gets a Mautic contact, and Mautic has the latest data

But we’re wondering if we can do more, specifically if a user who already has a Mautic id tracked in the web-app logs into the web-app on a new browser - can we include some tag in the page to populate the new web browser session with the same Mautic user id - effectively using the web-app to bridge the gap between the two browsers and link them to the same Mautic user?

Thanks

Hi,
Before this can be answered, it would be interesting to know - is there a chance that 2 people use the same browser?

J

There is always a chance that a browser could have multiple users within the scope of a persistent cookie (whether within a given session or across multiple sessions for the same OS user)

(For convenience I’m just going to use “different browser sessions” to mean any case where a persistent cookie is not available, whether two different browsers on the the same machine, across different devices, or even after a cookie clear)

If two different browser sessions both login to a web-app as the same web-app user, there is a high likelyhood that they are the same user (particularly if the web-app involves managing user specific data and offers free and paid accounts - so sharing accounts does not make sense). The correlation should be of about the same quality as having two different browser sessions click on the same tracking link in an email .

Orthogonally from this question of linking a user across browser sessions, we have the interesting question of how to handle a session with a Mautic id linked to one web-app user then logs into the web-app with a different web-app user - do we do something to replace the Mautic cookie with one linked to the new web-app user (I assume so - this is likely akin to someone clicking on a tracking link on an email when there is a different Mautic user id already in the cookie)

I’m hoping that covers the question :slight_smile:

David