Have you been researching how best to set up Google Analytics for your SaaS or Ecommerce site where you are using sub-domains?
Well, this post is simple. We will address these two very specific use cases.
Google Analytics Setup for SaaS and basic E-com sites with sub-domains!
In most cases a business is using sub domains and not actually two separate domains. Hence, the goal is to make sure that users coming from sub-domain
If a user starts a session on offer
Similarly, most SaaS have a setup where app
In all the above use cases, we are using a sub domains, and not a new separate domain.
Now, after much research here is what I found regarding sub domain tracking.
Yep, per Julian from Measure School,
You need not do much of anything if you are using Google Tag Manger to fire off your Google Analytics.
GTM, for sub-domain tracking you just need to make sure you have these things in order.
Inside GTM -
Createa Google Analytics Variable
Inside GTM - Make sure the Google Analytics Variable has Cookie Domain setting
of'auto ’which is default.
Inside GTM - Configure Tag to fire on all pages.
In Google Analytics - add main domain to Referral Exclusion List (no sub-domains)
Test - Use Chrome Tag Assistant to check the GTM and Google Analytics codes are firing and use GA Debugger to see session
is maintainedacross sub-domains.
If you have implemented the above steps in your Tag Manager and are firing off the GTM code on your main and all sub-domains, the Chrome Tag Assistant will look something like this.
Here is how to test if the
a) GA Debugger extension to turn it on
b) right click on the page and click on 'inspect'
c) Click on 'console' tab and search for '
d) Click on a link within your page that will take
e) Clik on '
Basically, we want to check if
Yep. that is all you need to gather accurate data if your use case involves sub-domains!
Now, if the sub-domain use case does not apply to you and you have two unique domains and need to combine your Google Analytics into one account, here is the best video I found on Cross-domain Tracking with GTM by Julian from Measure School that will walk you through the setup.