Cross Domain Tracking: Why it’s Important and How to Set it Up in Google Analytics

Marketing Strategy
Chris Sharpe Chris Sharpe

To effectively manage you must accurately measure. This is a rule of thumb I try to live by professionally and personally. When it comes to managing web presence, Google Analytics is a really great free tool that is available to help measure your performance. 

The thing to remember with tools is that they are only great if they are set up correctly. This post will dive into a commonly overlooked but very important step in setting up Google Analytics: cross domain tracking.

What Is Cross-domain Tracking?

Many companies have more than one domain that represents their business offerings. Examples of this can be seen in the form of an e-commerce website ( that directs users to a third party shopping experience (, or a financial institution that uses an off-site application portal. Cross domain tracking enables these types of businesses to better understand the entire user journey as they navigate from one domain to another.   

One important thing to note is that I am specifically talking about tracking for different domains and not for subdomains. If your website utilizes subdomains such as you will want to implement subdomain tracking. Here are some good instructions for getting subdomain tracking set up.

Why Cross Domain Tracking is Important

To help illustrate the importance of fully tracking users, consider this example. Let’s say your company owns two different domains, and If you were to look at a user behavior report in Google Analytics for a website ( that sends users to a different domain ( to apply for an offer, you would probably notice a remarkably low time on site and relatively low pages per session. At first glance, this may appear as though you are providing a poor experience for your users as these metrics can help measure user engagement with your website. However, upon closer evaluation, it would become apparent that your visitors are actually doing what you desired in the first place: applying for an offer.

Besides gaining the ability to better track users while they are navigating your domains, cross domain tracking helps to better illustrate the way that people are arriving at your website. 

Continuing from the previous example, let’s say that after a transaction has occurred the user gets sent back to your primary domain. If you were to look at the acquisition report in Google Analytics, you would likely see a large amount of traffic coming through the referral channel. This would be great if these were actual referrals, however, they are simply users that were previously on your main site anyways.

These are just a few examples of why cross domain tracking is an important part of setting up Google Analytics. Next, I will explain how to implement cross domain tracking in your reporting.

How to Implement Cross Domain Tracking

Before we begin, I want to make sure this is clear: There are a couple of different ways to implement cross domain tracking. However, I will be explaining the Google Tag Manager method because I believe this is the easiest to implement and control. 

Make sure that you are tracking pages in Google Analytics through Google Tag Manager. If you currently have Google Analytics collecting data in another way, such as a plugin or a code snippet on your website, now would be a good time to switch to Google Tag Manager instead.

Part One: Setting up Tag Manager

In Google tag manager navigate to your Google Analytics variable. This will need to be updated to allow the linking of multiple domains. To do this click the little pencil in the top right corner to edit this variable. 

Cross Domain Tracking: Why it’s Important and How You Can Set it Up in Google Analytics

Next, select “more settings” and select “Fields to Set”. Here you will add the following (this is case sensitive):

For “Field Name”: allowLinker

For “Value”: true

Cross Domain Tracking: Why it’s Important and How You Can Set it Up in Google Analytics 1

After these fields are filled in, scroll to “Cross Domain Tracking” and enter the domain names that you want to track into the “Auto Link Domains” box. Note that this is a comma-separated list.

Cross Domain Tracking: Why it’s Important and How You Can Set it Up in Google Analytics 2

Click save and now it’s on to Google Analytics.

Part Two: Configure Google Analytics

Next, you will want to make sure Google Analytics is set up to understand and correctly display the changes you have just made in Google Tag Manager.

In order to do this, you will first need to add the new domain to the referral exclusion list. To do this, navigate to the admin section of Google Analytics.

Cross Domain Tracking: Why it’s Important and How You Can Set it Up in Google Analytics 3

Under the Property section, click “Tracking Info”. Then select “Referral Exclusion List”. Then click “Add Referral Exclusion and enter your newly added domain.

Cross Domain Tracking: Why it’s Important and How You Can Set it Up in Google Analytics 4

Next, we need to update the way that page URLs are displayed in reports. Google Analytics will need to be modified to show the entire URL so that you know which domain is being referenced in reports. By default, Google only displays everything after .com/ so the homepage for both domains will look identical if no action is taken. 

To fix this, follow these steps:

Navigate to the admin section of Google Analytics. Select the view that you would like to utilize for reporting. I usually have at least three views set up one for testing, one for unfiltered data, and one with my desired filters. Under that view select “Filters” and click “Add Filter.”

Cross Domain Tracking: Why it’s Important and How You Can Set it Up in Google Analytics 5

Name your filter and select “Custom” under filter type:

  • Select “Advanced” and set “Field A” to Hostname = (.*) 
  • Then set Field B to Request URI = (.*)
  • Then set Output to = Request URI = $A1$B1
  • Finally, check Field A required and Override Output Field

Cross Domain Tracking: Why it’s Important and How You Can Set it Up in Google Analytics 6

Now you will be able to easily determine which domain you are referencing in Google Analytics reports.

And there you have it. You are now able to track user behavior across your domains and better understand the effectiveness of your marketing.