Cross-domain tracking is not something everyone does; most website operators track only their root domain.

Are you looking to have more advanced and precise tracking on your Google Analytics (GA) accounts across multiple domains or subdomains?

This article may help you determine whether and what type of cross-domain monitoring can be beneficial to your website.

What constitutes a domain?

A domain is composed of a top-level domain (TLD), such as co.uk or .com, and a second-level domain (SLD), can be a company name, your name, or any identification of the site.

A TLD can generally be a country identifier like .ca or .fr, or one of a different kind, such as .org, or .net.

The SLD is more representative of the website and is often referred to as the “parent” domain.

To illustrate a website domain and all its parts, let’s take an example of a SALT.agency blog post URL:

https://salt.agency/blog/how-to-conduct-a-google-analytics-data-based-content-audit/

  • HTTPS://: protocol
  • agency: hostname and root domain
  • salt: SLD
  • .agency: TLD
  • /blog/: path
  • /how-to-conduct-a-google-analytics-data-based-content-audit/: slug

A domain also enables generating customised email addresses such as [email protected].

A subdomain is a category of the domain, and you can create an unlimited number of different subdomains — for example, blog.example.com, shop.example.com, or news.example.com.

To track the activity on your site, such as traffic, conversions, bounce rate, etc., you probably are using Google Analytics data.

The question is, however, what data should you track — your root domain only, or your subdomains as well?

What tracking method do you require?

You should only track root domain activity if users don’t move between root domains and subdomains.

  • Set up cross-domain tracking if users will be moving between domains and you wish to track this activity on both domains.
  • If your users move between root domains, but you wish only to track one, then you have the option of creating a referral exclusion list (if they return to the original domain), or to set up click-out tracking if they stay in the second root domain.

Let’s examine each of the four options individually.

Cross-domain tracking

For Google Analytics to track a user’s activity across both domains, the user’s ID needs to be passed between the root domains.

The user’s ID can be obtained via GA cookies, however, root domains cannot share it.

To fix this issue, a Linker plugin can be used, which automatically amends the website URL by including a parameter and tracking every time a user clicks on the link.

How do you add a plugin?

In Google Analytics Settings, localise the Cross-Domain Tracking section and set Auto Link Domains to use your new variable.

To add Linker plugin, in the Fields to Set section, type allowLinker and change Value to True. Now your Linker plugin is active, and cross-domain tracking activated.

For instructions on how to set up cross-domain measurements by changing analytics.js code, click here.

Referral Exclusion List

As the name suggests, the referral exclusion list encompasses root domains that you communicate to Google Analytics. These are the sources from which you do not wish to count traffic as a new session.

This way, multiple sessions will not be triggered if a user moves back and forth between your domains.

To create the referral exclusion list, in your Google Analytics account, locate and click on the cog icon in the bottom left corner. Under the ADMIN tab in Tracking info, you will find the Referral Exclusion List section, in which you can add and remove referral exclusions.

External Click-out Tracking

The previous two methods focus on tracking the provenance of your traffic. However, external click-out tracking measures the points at which users abandon your website, which might provide additional information for a further investigation of landing pages.

This is done through Google Tag Manager. Configure the variable by imputing the built-in {{Click URL}} variable in the URL Source section and by outputting hostname with www stripped out.

Cross-subdomain tracking

Although it is not possible to share user ID between root domains, you can share it between subdomains.

How do you cross-track subdomains?

Firstly, in the Google Analytics standard settings, set the Cookie Domain to auto, secondly, in the ADMIN tab, exclude your root domain following the guidelines in the Referral Exclusion List section.