Earlier this year I published a case study about how to track Google Analytics conversions across domains.  In the case study I explained how Google Analytics does not track visitors properly across different domains.  For example, if your website links to a 3rd party shopping cart or scheduling tool, then you’re likely not tracking that traffic accurately.

The problem is that by default Google Analytics will think all traffic that crosses between your website and the 3rd party domain is either referral traffic (referred from the 3rd party domain to your website and vice versa) or direct traffic.  Therefore, all of your traffic from different marketing channels (SEO, advertising, social media) will not be reported correctly in Google Analytics.

This is a huge problem that should be fixed as quickly as possible so that you can accurately measure the performance of each of your marketing channels.

In this article, I’ll walk through the four steps to setting up Google Analytics cross domain tracking for any website you’re using.

unnamed-1

Step 1. Add the Same Google Analytics Property to All Domains

The first step is simple – Add the same Google Analytics code to each domain.  For example, if you’re using a 3rd party shopping cart, then you need to copy and paste the Google Analytics code that is on your main website on to the 3rd party shopping cart pages.

Once you’ve added the Google Analytics code to the other domains, then all the traffic to those pages will start to be tracked within your Google Analytics account.

Of course, this is just the first step so don’t stop here!  Again, by default, Google Analytics will think that all the traffic flowing between the domains is referral or direct traffic.  That’s not what we want.

We want the original source of your website traffic to carry through to the other domains.  For example, if the original source of your website visitor was Organic Search (SEO Traffic) and then that same visitor added a product to their cart and purchased on your 3rd party shopping cart, then you want that sale to be attributed back to Organic Search, not Referral traffic!

So let’s move on to step 2…

Step 2. Add Domains to the Referral Exclusion List

The second step is to add your domains to the Referral Exclusion List.  This is a list of domains that you don’t want Google Analytics to count as referral traffic.  A classic example is if you have a subdomain like shop.yourdomain.com in addition to your main website, yourdomain.com.  Obviously when visitors go between those two domains, they shouldn’t be tracked as Referral traffic.

To add domains to your Referral Exclusion List, go to the Admin section of your Google Analytics account.  Then click on “Tracking Info” under the middle Property column.  A new set of links will pop out and you’ll be able to click “Referral Exclusion List”.

On that page you can add all the domains you use that shouldn’t be treated as real Referral traffic in your Google Analytics reports.

These first 2 steps are pretty straight forward, but unfortunately we’re about to get a little more technical…

Step 3. Add the Linker Parameter

As mentioned above, this third step is a bit technical.  However, it’s not actually hard to implement. So even if you don’t fully understand why you need to complete this step, you should still be able to complete it and get your tracking set up properly. :)

But if you really want to know, then here’s why this step is important…

In order for Google Analytics to track website visitor behavior, the program uses a browser cookie.  This cookie stores information about the visitor and then that information is sent to Google Analytics.  Simple enough.

Where it gets complicated is the fact that cookie information for one website can not be accessed by other websites.  In other words, Google Analytics code on your 3rd party shopping cart can not access the cookie information that was saved on your main website.  This is a problem because we need to share this information across the domains.

The workaround solution is the linker plugin.  The linker plugin automatically shares tracking information (specifically the unique visitor ID, timestamp, and browser info) across domains.

I told you it was going to get technical. :)  However, you don’t really need to know the specifics here.  All you need to know is that you have to turn on the linker plugin for this to work.

To automatically add the linker parameter, you need to add the following code within the Google Analytics code on your website (don’t forget to replace ‘destination.com’ with the correct domain!):

// Loads the Linker plugin
ga('require', 'linker');
// Instructs the Linker plugin to automatically add linker parameters
// to all links and forms pointing to the domain "destination.com".
ga('linker:autoLink', 
['destination.com'], false, true);

OK, we’re almost done.  On to step 4…

Step 4. Configure allowLinker

The fourth and final step is to tell the Google Analytics code on your 3rd party shopping cart or 3rd party tool to read the linker parameter information.  If you skip this step, then the Google Analytics code will ignore the linker parameters that you set up in step 3.

Again, this sounds technical, but it’s not that hard to set up.  Simply add the following code within your Google Analytics code on the 3rd party shopping cart or 3rd party website tool:

ga('create', 'UA-XXXXXX-X', 'auto', { allowLinker: true });

The “allowLinker: true” above is the key to making this work.

That’s it! If you complete all 4 steps above, then you’ll be successfully conducting Google Analytics cross domain tracking and attribute leads and sales conversions back to the correct source of traffic.

Want more Google Analytics tips?

Click here to get our Ultimate Google Analytics Checklist