Do I Need Cross-Domain Tracking?

/

do-i-need-cross-domain-tracking
Cross-domain tracking is one of the more complex, confusing and often misunderstood areas of web analytics. It involves cookies, browser security settings, and an understanding of your overall measurement strategy.

I hope to simplify some of this for you with a simple flowchart, that will tell you whether or not you need cross-domain tracking to begin with. This is the first question that frequently stumps web analysts.

But before you dive into the flowchart, let’s get some things straight:

Let’s Define domain and subdomain

We’ll be defining domain and subdomain for the purposes of cross-domain tracking in Google Analytics. As such, this is a simplistic explanation of the distinctions, and doesn’t fully examine the subtle differences. If you’d like to learn more, the Wikipedia entry for Domain name is rather extensive.

The domain (also called the root domain) is the part of the website address immediately before the .com (or .net, .edu, .org, etc.). For example:

Full Website URL: http://www.example.com

The Domain Is: example

The subdomain is the part between the http:// and the first dot (.). In our example, www is the subdomain, but consider the following examples:

Full Website URL: http://video.example.com

Full Website URL: http://blog.example.com

Full Website URL: https://shop.example.com

The Subdomains Are: video, blog, and shop, respectively.

Bonus: For extra credit, the part at the end – com, org, edu, etc. – is called the top level domain, or TLD. This is important because from the perspective of cross-domain tracking, example.com and example.org are considered two separate domains.

Do I Need Cross-Domain Tracking?

We use cross-domain tracking with Google Analytics to track multiple websites into one property and to make sure that one user that travels between multiple sites is tracked as a single user. Generally this means that even though there are multiple domains, they serve the same audience and appear to the user as if they’re the same site.

Sometimes, cross-domain tracking is not necessary. Take a look this flowchart:

Cross-Domain Tracking Flowchart

If you followed the chart and determined that cross-domain tracking is necessary, then we’ve got a great setup guide for Google Tag Manager. You’ll need to be able to make changes to your website code or through Google Tag Manager, and you’ll need to follow several steps, which we’ve outlined for you.

What About Subdomains?

Cross-domain tracking only applies if you have multiple domains. If you have a single domain with multiple subdomains, cross-domain tracking is not necessary!

If you have two or more subdomains that you’re tracking into the same Property in Google Analytics, the default tracking code for that Google gives you to put on your site is already set up to automatically work across your subdomains.

Google Analytics Tracking Code

This wasn’t always the case. With the older versions of the Google Analytics tracking code (anything before Universal Analytics and the analytics.js library), you had to modify your tracking code to explicitly tell Google Analytics to set the cookie at the root domain level. That way, all of your subdomains would be able to read and write to the same cookie. Now, that happens automatically.

There are two easy steps for cross-subdomain tracking, 1) Set the Cookie Domain and 2) Update Your Referral Exclusion List. For more information, check out our guide here: Two Steps To Correctly Tracking Subdomains in Google Analytics

Jim Gianoglio is a Senior Analytics Consultant. He works with implementation, analysis and training of Google Analytics and Google Tag Manager. Before focusing on analytics, he led the SEO campaigns of Fortune 500 companies in the insurance, retail and CPG industries. Things you didn’t know about Jim: he’s biked from Pittsburgh to Washington DC in 41 hours, roasts coffee beans and has done voiceovers for TV commercials.

  • https://be.linkedin.com/in/nicktulpinck Nick Tulpinck

    Great article! Does cross-domain tracking with a single domain and multiple subdomains works automatically as well, when you implement Google Analytics through Google Tag Manager?

  • Cecio82

    It depends on how you configure GA instructions via GTM, not on GTM itself.

    GA automatically handles cross domain tracking between subdomains belonging to the same primary domains (let’s say: a.example.com, b.example.com and http://www.example.com), if you properly set cookie domain to “example.com” (or ‘auto’).

  • Jim Gianoglio

    Cecio82 is on the spot! In GTM, you just need to make sure you have ‘cookieDomain’ set to ‘auto’ under the Field to Set section.

    Unfortunately, this is not automatically enabled in GTM, even though it’s the default setting in GA.

Contact Us.

LunaMetrics

24 S. 18th Street, Suite 100,
Pittsburgh, PA 15203

Follow Us

1.877.220.LUNA

1.412.381.5500

getinfo@lunametrics.com

Questions?
We'll get back to you
in ONE business day.