Ad

Cross Domain Tracking Google Analytics

In a project I am currently using something similar to the following:

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-12345678-1"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-123456789-1');
</script>

On this site, we currently have the following flow during sign up:

Email Landing Page (domaina.com) -> 
Registration Page (domainb.com) -> 
Payment Provider (payment.com) -> 
Confirmation Page (domainb.com).

We would like to track users from the first step of this process (domaina.com) through all the other domains and up to the confirmation page.

We have no control over the code on the payment.com page but we can control all others.

What I am wondering is how to track across these domains?

From what I can see, I can add something similar to the following:

'linker': {     
  'domains': ['domaina.com', 'domainb.com', 'payment.com']   
  }
}

as part of the config. However, if we don't have GA on the payment.com page, will this still track across those sites?

Ad

Answer

You can only track hits for the domains on which you can place the GA code for the GA accounts that you own. Therefore payment.com won't be tracked in GA.

What will happen in your reporting view is:

  1. User goes to domaina.com -> all hits tracked
  2. User taken to domainb.com -> all hits tracked
  3. User taken to payment.com -> no hits recorded
  4. User returns to domainb.com -> all hits tracked

The problem lies in Step 4. When the user returns, they may be seen as a referral from payment.com, thus starting a new session and all revenue will be attributed to payment.com (instead of what brought the user to domaina.com in the first place).

To overcome this, add payment.com to your referral exclusion list

Ad
source: stackoverflow.com
Ad