If you run blog.example.com, shop.example.com, and www.example.com, the usual worry is broken sessions and inflated user counts. GA4 handles subdomains automatically, but its reports hide the split by default.
This guide covers what happens under the hood, the setting you should leave alone, and how to see which subdomain sends the traffic.
Does GA4 track subdomains natively?
Yes. In Universal Analytics you often had to set the cookie domain to auto so a visitor moving from the main site to the blog stayed one user. GA4 removes that work:
- GA4 sets its cookie at the highest level of the domain — for example,
.example.com. - Because the cookie sits at the root, the user ID persists across every subdomain.
- A visitor who lands on
www.example.comand clicks through toshop.example.comcounts as one user in one session.
The one rule: a single measurement ID
For this to hold, every subdomain must use the same data stream, and therefore the same measurement ID — the one starting with G-.
If you create a separate data stream or property for a subdomain, GA4 cannot join the journey. You will see self-referrals and split sessions instead.
Cross-domain vs subdomain tracking
The GA4 admin setting Configure your domains is for cross-domain tracking. Do not use it on subdomains.
- Subdomain tracking is automatic. Users moving between
blog.site.comandsite.comneed no configuration. - Cross-domain tracking is manual. It is for
site.comand a completely different domain, and it needs setup.
Adding subdomains to the "Configure your domains" list adds complexity and can break attribution.
Why hostnames matter in reports
GA4 collects subdomain data correctly but does not always show it. Reports default to the Page path dimension — for example, /contact-us. If /contact-us exists on both your main site and a help-desk subdomain, the report merges them. The Hostname dimension separates them.
Setup
Phase 1: install and validate
- Open GA4 Admin and go to Property settings.
- Go to Data collection and modification > Data streams, click your web stream, and copy the measurement ID (for example,
G-12345ABC). - Paste the same tag — or the equivalent Google Tag Manager config tag — on every subdomain you track (
www,blog,shop,support). - Open DebugView, move between subdomains, and check that events keep flowing without the user dropping off.
Phase 2: add hostname to your reports
- Go to Reports > Engagement > Pages and screens.
- Click the pencil icon (customize report) in the top right.
- In the sidebar, click Dimensions.
- Click Add dimension and search for "Hostname".
- Open the three-dot menu next to Hostname and choose Set as default.
- Click Apply, then Save.
Your Pages report now shows both page path and hostname, so you can filter and segment by subdomain.