Cross-domain tracking with Google Analytics


This method will still continue to work and can still be used, however, we advise using the new Google Analytics tracking noted here, which handles ThriveCart’s side. You will still need to add cross-domain support on your website.

1. Using Google’s gtag.js tracking script

Cross-domain tracking using gtag.js is quite simple and simply requires a minor addition of code to your existing gtag.js script.

Specifically, adding this section of code:

'linker': {
  'domains': ['', '', ''], // Change these to point to your multiple domains
  'accept_incoming': true

Your total gtag.js code would then look like:

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src=""></script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'YOURPROPERTYIDHERE', { // Paste your property ID here from the example gtag script - note it ALSO goes above!

  'linker': {
    'domains': ['', ''], // Change these to point to your multiple domains
    'accept_incoming': true


Remember that “YOURPROPERTYIDHERE” would be replaced with your own tracking ID from Google AND the domains would list your actual websites and ThriveCart subdomain.

2. Using Google’s analytics.js tracking script

See the video below for a tutorial on Cross-domain tracking and Google’s analytics.js tracking code.

In the video below we take a look at setting up cross-domain tracking for Google Analytics using the analytics.js tracking code.


  • Get the analytics.js tracking code – click here.
  • Review Google’s official documentation – click here.
  • Google Tag Assistant Chrome extension – click here.
  • Google Analytics debugger Chrome extension – click here.

Please note that we are not responsible for the above browser extensions, we do not provide support, nor are we responsible for any misuse or issues arising from using them.

Related Articles