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

(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
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

Forex trading strategies for Finbok users

Advanced Forex Trading Strategies For Finbok Users

22 June 2024

Posted by Muhammad Noman in Money Talks

We take a look at some of the advanced forex trading strategies you can employ using a broker like Finbok and improve your chances of turning a profi...

Read more
Pros and cons of buying Ethereum with your credit card

Using A Credit Card to Buy Ethereum

19 June 2024

Posted by Joody Silous in Money Talks

We take a look at the benefits and drawbacks of using a credit card to buy Ethereum should you want to get into this asset class and own some digital...

Read more

Leave us a comment


{{comment.iDayLastEdit}} day ago

{{comment.iDayLastEdit}} days ago


Sign up for our newsletter