Search code examples
google-analyticssingle-sign-onanalyticsgoogle-analytics-apiuserid

How to track & ID users in Google Analytics while registration/login via an other domain?


We have Multiple products, all are using one SSO (Single Sign On & Registration). So when visiting product A: www.AAA.com, the user (when register or sign-in) will have to go to: sso.mainsite.com to go through registration or login, then it will redirect him to the product page that he came from.

I want to track unique users properly so:

  • I know each user from where he was acquired. (e.g. Mailchimp campaign? Social Media?..etc)
  • Each user activity in the product is always linked to him (Made purchase, did an activity...etc)
  • Statistics Not be affected by the common SSO site, where multiple product users are directed there to login or register. I want to be able to identify product A users.

We have Analytics Account for the main site (inc. SSO) and an account for product A. I'm having difficult time:

  1. Should I use the product A tracking code in the SSO (to have multiple tracking codes on that page)?
  2. Identifying users by Google's new User ID, should we let the SSO identify them (assign ID) or by Product A, when the user get transferred there?

I know i'm asking a lot, but i'm having difficult time knowing what is the best approach, not to damage any statistics. Thank you!


Solution

  • If you want to track the session on www.AAA.com without interruption it should be enough to add sso.mainsite.com to the referral exclusion list in the property settings in www.AAA.com's GA account.

    That way sso.mainsite.com will not appear as a referrer, instead the session including channel attribution will be continued when you redirect back from sso.mainsite.com. This will completely ignore the pageviews on your sso page.

    The alternative would be to set up cross domain tracking, if you want to include the detour to sso.mainsite.com into the tracking. That would be somewhat complicated, and unless you signal that this is really what you want I will not even bother to explain the setup.