GA4 Subdomain Tracking Explained
GA subdomain tracking works very differently than cross subdomain tracking in Universal Analytics. The good news is that tracking across subdomains is one of the places where GA4 has a big advantage over UA.
The Root & Branch website doesn’t have any subdomains. But let’s say it did. Let’s say that all blog pages like this one lived at blog.rootandbrachgroup.com, while all other pages lived at rootandbranchgroup.com. The first of those would be the subdomain.
- blog.rootandbranchgroup.com = example of what a subdomain looks like
- rootandbranchgroup.com = example of the primary domain
In Universal Analytics we would need to go through a complex set up process to track visitors from the subdomain to the primary domain (and vice versa). But in Google Analytics 4 it’s incredibly easy. It’s so easy in fact that it happens automatically.
I’m not kidding. If that’s all you needed to know you can stop reading now. Maybe you can go read about something more confusing in GA4 like event parameters. But if you want to understand more about how to access your GA4 subdomain data, you can read on below.
Does Google Analytics 4 Track Subdomains?
Yes, GA4 does really and truly track subdomains. And it all happens automatically as well. That means that if you have one (or more) subdomains, you don’t need to do anything to make sure GA4 is tracking those visitors. As long as the primary domain has the GA4 configuration tag installed, the subdomains will be tracked.
I literally did not believe it myself when I first discovered this, so if you’re still in shock I’ll give you a minute. But it’s true. You just need to make sure your GA4 Measurement ID (the unique identifier in your configuration tag) is properly installed on your primary domain. The rest happens by GA4 magic.
That Measurement ID, by the way, is hidden in the green box below. You see it in your Admin section when you click into your Data Stream. If that sounds confusing, you may want to check these 10 steps to make sure your GA4 property is installed and configured properly.
There are some specific situations that are worth exploring further. Let’s check those out and then look at how we can isolate our subdomain data in GA4.
What if My Subdomains Have Different GTM Container Codes?
Many subdomains are set up this way. The primary domain has one Google Tag Manager container code. The subdomain has another Google Tag Manager container code. In the days of Universal Analytics (UA), each of those container codes would hold different UA properties.
With GA4, you can still keep those multiple container codes. However, all container codes should hold the same GA4 Measurement ID (see image above) in their GA4 configuration tags.
What About Unwanted Referrals?
Let’s back up a step start about the beginning with this unwanted referral business.
What Are Unwanted Referrals in GA4?
Here’s what Google says about referrals in their support article.
Referrals are the segment of traffic that arrives on your website through another source, like through a link on a third-party domain. Analytics automatically recognizes where traffic was immediately before arriving on your site, and displays the domain names of these sites as the referral-traffic sources in your reports.
If you have an unwanted referral, it’s a traffic source that you don’t want to show up in your traffic acquisition reports.
What Happens When You Add an Unwanted Referral?
Here’s what Google says in that same support article.
When you create these conditions, Analytics evaluates events sent from your website and appends the
ignore_referrerparameter with a value of
trueto every event that matches the conditions (
ignore_referrer=true). This parameter indicates to Analytics that the referrer should not be displayed as a traffic source.
To sum up, all events associated with something on the unwanted referral list get an extra parameter appended to them. That parameter is the ignore_referrer parameter, set to true.
Do I Need to Add My Subdomains As Unwanted Referrals in GA4?
I’m not 100% sure, but I believe the answer is NO. Like everything else with GA4 subdomain tracking, there is little manual work you need to do.
From what I’ve been reading, there seem to be mixed opinions but I haven’t found anything solid that convinces me that you do. Plus, if you look at adding a new domain to the GA4 unwanted referrals, there is no reference to subdomains. Everything is at the domain level.
Check that out below with all 5 options in the dropdown menu specifically referencing the domain level.
With all that said, I’ve been wrong before. So if you think I’m wrong, drop a comment and tell the world (the small segment of the world interested in GA4 subdomain tracking, at least). I’ll update the article and give you full attribution for being smart while I am less smart.
You can also see that I’ve added a question in the Google Analytics community, so feel free to answer over there if you know with 100% certainty. Thanks!
How Do I See My Different Subdomains in GA4 Reports?
A tricky thing about GA4 is that you won’t see the full URL in many places. Instead, you’ll see the page path, which is everything in the URL that comes after the domain and / or subdomain. You can use secondary dimensions and filters to get to the data you want to see.
The trick is using hostname.
What’s a Hostname in Google Analytics?
The hostname is the place where your Google Analytics 4 tracking code is present. This includes your domain and any subdomains.
How to See Hostname in GA4 Page Reports
The report below is the Pages and Screens report in GA4. The default dimension is to show the Page path and screen class of each URL on your site. This includes all pages on the primary domain and all pages on subdomains. If you want to see what hostname (domain or subdomain) those pages are associated with, add a secondary dimension for Hostname.
Check it out below.
What if I Only Want Certain Subdomains in My Reports?
This is where filters come in.
Hit the filter icon in one of your standard reports to access the Filter builder. You can see this below.
You can use an “Include” filter based on the Hostname dimension. Then, simply select the subdomain or subdomains that you want to report on.
This same approach will work if you’re building an Exploration for your GA4 reporting. That’s it!
Looking for something else? Feel free to leave a note in the comments or on the Root and Branch YouTube channel at youtube.com/@rooted-digital. We’re always looking for new content ideas!
Don’t forget that Universal Analytics data will no longer be processed in that platform beginning July 1, 2023. In other words, now is the time to get more comfortable with GA4.
If you’re still someone learning about GA4 (as I am), I’d recommend checking out this GA4 vs. UA comparison or this list of updated GA4 questions. You can also subscribe to the Root and Branch YouTube channel for an updated video every week or so. I’ll see you there! There are explainers and tutorials for tracking like this.
- GA4 page timer tracking
- Bounce rate in GA4 vs UA
- How to set up a GA4 form submission conversion
- How to see UTM tagged campaign data in GA4
- How to create the Source/Medium traffic report in GA4
- How to set up a custom dimension in 7 steps (and why you need to if you want to see event parameter data)
- Goals in GA4 explained vs UA
- How to link Google Ads and GA4
- How to link Google Search Console and GA4
About Root & Branch
Root & Branch is a certified Google Partner agency and focuses on paid search (PPC), SEO, Local SEO, and Google Analytics. You can learn more about us here. Or hit the button below to check out YouTube for more digital marketing tips and training resources.
Trackbacks & Pingbacks
[…] in GA4, you’d need to add both domains as web data streams within the same property. Cross subdomain tracking in GA4, on the other hand, happens automatically. Both cross domain and cross subdomain tracking are […]
Leave a ReplyWant to join the discussion?
Feel free to contribute!