LOG IN OR SIGN UP
Log in to your account
Sign up

How To Track Visitors Across Multiple Subdomains In GA

22 March 2017 | 0 comments | Posted by Che Kohler in nichemarket Advice

How to track visitors across subdomains

As an SEO nothing breaks my heart more than the improper use of a subdomain or multiple subdomains. In my time I've seen a string of common mistakes when using multiple subdomains. Poor use of multiple subdomains causes a split site's authority, duplicating content or worse having domains penalised and having entire sites de-indexed by search engines. It basically, makes a SEOs work twice as hard.

Don't get me wrong, I have nothing against subdomains and when used with consideration for search engines it can give provide your site with a powerful weapon. A subdomain can give you an edge over competitor sites by offering your site improved load balancing, speed improvements as a content distribution network or a superior mobile experience but that's a post for another day.

In this post, I'll be handling how to tracking visits across multiple subdomain architectures. If you're already running multiple subdomains and want to improve the quality of your data, I'll take you through how to combine your all your sites into one Google Analytics view.

If you have a multiple domain setup check out our article How To Track Your Visitors Across Multiple Domains In GA

What is a subdomain?

A subdomain is an internet domain which is part of a primary domain. It is an entirely new website, with its own unique content and attributes, but instead of a new domain name. It lives off the top level domain as an extension. Examples of a domain with subdomains are:

  • Top-level domain: www.nichemarket.co.za
  • Subdomain: media.nichemaket.co.za
  • Subdomain: dashboard.nichemarket.co.za

Basic example of a subdomain

Examples of subdomains - Image by pi-datametrics.com

Why do subdomain cause tracking issues?

The problem is no matter what it looks like or what you use it to search engines and reporting tools it's seen as a completely different site and is handled as such. If you have multiple subdomains you will more than likely have multiple Google Analytics accounts to track each domain separately, which isn't ideal as it fragments your data sets and makes analysis a nightmare. To complicate things even further is the fact that there is a complete disconnect between visitors.

When actually putting together reports you have no way of attributing which traffic came from which sources as traffic that moves from one domain to another will be grouped together as referral traffic. Skewing your data and rendering it almost useless. There are ways to get around this issue but unless you're a reporting whizz and can set up complicated attribution models or you can dev a unique identifier cookie you were out of luck. Until now, with subdomain tracking, you simply slap on some extra code to your current GA script and it does all the heavy lifting for you.

How to track subdomains in Google Analytics

1.Google Analytics Cookie Domain Setup

Add the following script with your Google Analytics ID into the head tag of all pages across all your subdomains

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXXXX-Y', 'auto');
ga('send' , 'pageview');

1. Google Tag Manager Setup

  1. Install Google Tag Manager Snippet on all of your domains and create the tag in each subdomain container
  2. Open up your Google Tag Manager account
  3. Create a new tag
  4. Select Universal Analytics as the tag type
  5. Add your Google Analytics Tracking ID
  6. Select page view as the track type
  7. Click more settings
  8. Click field to set
  9. Set field name to cookieDomain and value to auto
  10. Set firing trigger to page view, all pages
  11. Save your tag and publish

2. Referral Exlusion list

This should be setup by default already, but it’s worth double-checking. In the Admin Panel, the root domain must be added to the Referral Exclusion List. This is an important step in the process because when the user moves from one domain to another (including subdomains of the same domain), the Universal Analytics code will send referrer information to Google Analytics.

When Google Analytics sees a new referrer that is different from original source/medium information, it will start a new session with the new traffic source information. The Referral Exclusion List prevents this from happening and will let the original session continue.

Subdomain syncing

If you have a subdomain site structure without syncing tracking, how have you been handling your reporting? Do you feel this would be a better option for you? Let us know in the comments below.

Contact us

If you want to know more about improving your tracking solutions don’t be shy we’re happy to assist. Simply contact us here

Tags: Data Analysis, google analytics, google tag manager, tracking

Previous: {{ previousBlog.sTitle }}

Posted {{ previousBlog.dtDatePosting }}

Next: {{ nextBlog.sTitle }}

Posted {{ nextBlog.dtDatePosting }}

You might also like

Difference between Forex and Crypto trading

The Intricacies of Trading Crypto vs. Forex

03 April 2024

Posted by Josh Welman in Money Talks


A deep dive into the differences between the forex and cryptocurrency markets, along with the nuances you have to consider if you trade these two ass...

Read more
Tips to maintain your dogs oral health

How To Maintain Your Dog’s Oral Hygiene At Home

14 March 2024

Posted by James Uba in Fur, Fins & Feathers


A detailed look at how dog owners can put together a oral health care routine for their furry family member and ensure that their dogs pearly whites ...

Read more

Leave us a comment


{{comment.sUserName}}

{{comment.iDayLastEdit}} day ago

{{comment.iDayLastEdit}} days ago

{{comment.sComment}}

Sign up for our newsletter