We recently rolled out OneThreeOneFour for Hong Kong – a localised version in traditional Chinese. Our main website is on
www.onethreeonefour.com while the new localised version is on
We chose to use subdomains to manage the various languages. Unlike subfolders, each subdomain is considered as a different website. Hence, it got us thinking if it is possbile for Google Analytics to track visitors across different websites.
I want to keep all the data under a single Property in our Google Analytics account.
Cross-domain tracking visitors with Google Analytics
Subdomain Tracking with Universal Analytics
For most of us that are using the synchronous
analytics.js, the good news there is nothing more you need to do. That is because Google Analytics “sets cookies on the highest level domain it can” hence this “allows users to be tracked across subdomains without any extra configuration”.
Now that you are tracking vistors across your subdomains, the next step would be creating relevant Views for each website.
Create specific Views and Filters for each subdomain
By having a specific View for each of the sub domain, we can isolate the traffic between our main website and the other subdomains. In my case, I’m interested to see how many visitors we have on our English, Tradition Chinese and combined traffic.
By default, Google Analytics only displays the URI If you don’t create separate Views for each website, you won’t be able to differentiate which subdomain your visitor has landed. On the reports, it would simply show up as
/about-us without indicating if it is from
www.onethreeonefour.com or from
You would need to create at least three Views. One Master view for reporting combined traffic, one for your main website and another for the new subdomain. I name the Views, Master – onethreeonefour.com, www.onethreeonefour.com, zh.onethreeonefour.com.
For Master view, follow these steps to create a filter that shows full URL in your Google Analytics reports. I’m using this advanced filter only on my Master view, since you’ll be seeing report on combined traffic.
For each of the subdomain views, I added the pre-defined filter, Include traffic only to the hostname. This way, you will have isolated the traffic to these specific view making accurate analytics possbile.