How To Setup Cross Domain Tracking

Follow

How To Setup Cross Domain Tracking

Cross domain tracking is for top-level domains, like www.example.com and www.anotherdomain.com. For subdomains like sub.example.com, please see this  article.

To set up cross domain tracking for multiple top-level domains, you need to modify the Google Analytics tracking code on each domain. This guide will show you how to implement cross domain tracking using our Google Analytics or Google Analytics Premium plugin.

In order for cross domain tracking to function correctly, you must use the same Google Analytics tracking ID and update the tracking code to include the cross domain settings on every domain.  You must use either classic or universal tracking but not a combination on all of your domains.

Using Universal Analytics

For best results, please add all of your top-level domains to the referral exclusion list by following the steps  here before modifying the plugin settings.

1
The first thing you have to do, is log in to your WordPress website. When you're logged in, you will be in your 'Dashboard'. On the left-hand side, you will see a menu.
2
Go to Analytics > Settings and click the Advanced tab.
3
Check Add _setAllowLinker and enter the appropriate code (see below) in the custom code section. Your code may vary depending on your setup. Learn more  here.
If you have two domains, add this code:

__gaTracker('require', 'linker');
__gaTracker('linker:autoLink', ['example-2.com'] );
If you have three or more domains, add a comma separated list like this:

__gaTracker('require', 'linker');
__gaTracker('linker:autoLink', ['example-2.com', 'example-3.com'] );

4

Click Save Changes. Verify your analytic code matches the desired code by viewing the page source of your site. WikiHow has a great article that explains this. You can  find it here.

Using Classic Analytics

1
The first thing you have to do, is log in to your WordPress website. When you're logged in, you will be in your 'Dashboard'. On the left-hand side, you will see a menu.
2
Go to Analytics > Settings and click the Advanced tab.
3
Check Add _setAllowLinker and enter the appropriate code in the custom code section. The code depends on whether you are tracking a subdomain or a entirely different domain. Please see  this article to determine the code for your setup. You will only need to enter line(s) similar to this one:
_gaq.push(['_setDomainName', 'example-petstore.com']);
4
Click Save Changes. Verify your analytic code matches the desired output by viewing the page source of your site. WikiHow has a great article that explains this. You can  find it here.

 

Have more questions? Submit a request