How to Setup Cross Domain Tracking [Complete Guide]

I am sure, Many People don’t know what is Cross Domain Tracking ? and what is the use of Cross domain tracking and how we can setup cross domain tracking ? In this article, We are today going to learn on how we can implement Cross Domain Tracking.

What Is Cross Domain Tracking ?

Cross domain tracking makes it possible for Google Analytics to see sessions on two related sites (such as an ecommerce site and a separate shopping cart site) as a single session. This is sometimes called site linking.

  • How Cross Domain Tracking Works  ?

If you implement cross domain tracking on your website, then it is possible for Google Analytics to see this as a single session by a single user. Below is example of working of cross domain tracking :

Example-of-CrossDomainTracking-TechBlogCorner
This is How Cross Domain Tracking Works in Google Analytics

Set up cross domain tracking by modifying tracking code :

  1. Set up a property in your Google Analytics account.
  2. Use the same tracking code snippet and tracking ID from that property for all of your domains.
  3. Edit the tracking code for the primary domain.
  4.  Find the create line in the snippet. For a website called YourPrimaryWebsite.com, it looks like this:   ga('create', 'UA-XXXXXXX-Y', 'YourPrimaryWebsite.com');
  5. Make the following changes to the snippet (the changes you need to make are in bold Green text):   ga('create', 'UA-XXXXXXX-Y', 'auto', {'allowLinker': true});
    ga('require', 'linker');
      ga('linker:autoLink', ['YourPrimaryWebsite.com'] );
  6. For three or more domains :
    Follow the example above, but add the other domains to the autoLink plugin. Even the additional comma here is important: ga('linker:autoLink', ['YourSecondWebsite.com', 'YourThirdWebsite.com'] );

7. Now Edit the tracking code on the secondary domain.

Must Read-  Google Is Hiring An SEO Manager To Improve Its Rankings In Google

Find the create line in the snippet. Make the following changes to the snippet (the changes you need to make are in bold Blue text):

  ga('create', 'UA-XXXXXXX-Y', 'auto', {'allowLinker': true});
  ga('require', 'linker');
  ga('linker:autoLink', ['YourPrimaryWebsite.com'] );

8. For three or more domains :

Follow the example above, but add the other domains to the autoLink plugin. Even the additional comma here is important:

ga('linker:autoLink', ['YourPrimaryWebsite.com', 'YourThirdWebsite.com'] );

 

 

 

 

 

Leave a Reply