GA4 Subdomain Tracking: See Each Subdomain in Reports and Tag the Tools Behind Them
For sites split across www, blog, app, shop and help subdomains, often on different tools: how to get the tag onto each one, which builder addresses are not really your subdomains, and how to separate subdomain traffic in GA4 reports.
In short
One GA4 property can track all your subdomains if every one of them loads the same measurement ID. Subdomains served by another tool, such as a shop or help centre, need the tag added inside that tool. To see each subdomain separately, add the Hostname dimension to Pages and screens, a comparison or an exploration.
To track subdomains in GA4, put the same measurement ID on every subdomain, including the ones that run on someone else's software, and then use the Hostname dimension to see each subdomain on its own. Most setups that look broken fail on the first part: the main site is tagged, but the help centre, the shop or the landing page builder on a different subdomain was never given the tag. The second part matters because GA4's standard page reports merge all subdomains into one list by default. This guide covers both, plus the builder addresses that look like your subdomains but are not.
Do subdomains need cross-domain setup?
Normally no. The Google tag's cookie_domain setting defaults to auto, which stores the _ga cookie on the top-level domain plus one level, so www.example.com and blog.example.com both read the same cookie at example.com. That breaks only if one subdomain overrides cookie_domain or uses a different cookie_prefix, in which case it creates its own cookie, GA4 counts a new user there, and Google warns that this can show up as self-referrals. That is why Google's cross-domain help page recommends cross-domain measurement for subdomains, and why its fixes for self-referrals start with checking that all subdomains use the same cookie domain. Our guide to GA4 cross-domain tracking explains the _gl linker for that case and for separate domains. Meta Pixel's _fbp and _fbc cookies record their domain level too: the second number in the value is a subdomainIndex, where 1 means the cookie was set on example.com and 2 means www.example.com, as covered in fbclid, _fbc and _fbp explained.
Subdomains that run on another tool
A typical business has www on its CMS, app on its own product code, shop on an ecommerce platform, help on a support desk and go or lp on a landing page builder. Each one is served by a different system, and the Google tag you installed on the CMS does not travel to the others. Every tool has its own place to add it. Shopify, for example, sets up GA4 through the Google & YouTube sales channel, while Webflow has a Google Analytics field under Site settings, Apps & Integrations, and a Custom code section for Google Tag Manager that needs a paid site plan. Builders rename menus and change which plans include custom code, so check the platform's own help centre before you start. For a help desk or landing page builder, look in its admin area for an analytics, tracking or custom code setting, and check which plans include it.
| Subdomain | Shares the _ga cookie? | What to do |
|---|---|---|
| blog.example.com on the same CMS as www | Yes, if the same tag loads there | Nothing beyond checking it appears under Hostname |
| shop.example.com or help.example.com on another platform, connected as your subdomain | Usually, once the tag is added in that platform; confirm with the test below | Add the same measurement ID in the platform's own settings, then test |
| A subdomain where someone set a custom cookie_domain or cookie_prefix | No, it writes its own cookie | Remove the override so it matches the other subdomains |
| brand.myshopify.com or brand.webflow.io | No, it is a different site | Connect a custom subdomain, or set up cross-domain measurement |
Two checks apply to every hosted tool. First, use the same measurement ID as the main site, sending to the same property. A help centre tagged with an old property ID still collects data, just somewhere nobody looks. Second, avoid loading the tag twice: if the platform has a built-in GA4 field and someone also pasted a Google Tag Manager container that fires GA4, every page view is sent twice.
Addresses that look like your subdomain but are not
Many platforms give each customer an address on the platform's own domain. Shopify gives every store a myshopify.com address when it signs up, and Webflow sites have a webflow.io address. brand.myshopify.com looks like a subdomain, but it is a subdomain of Shopify's domain, not yours. Browsers go further: myshopify.com, webflow.io, wixsite.com and framer.app are all on the Public Suffix List, which browsers use to stop cookies being shared across high-level suffixes. Each customer's address is treated as a separate site, so cookies set on example.com can never reach brand.myshopify.com.
If visitors move between your site and an address like that, you have two options. The better one is to connect a custom subdomain such as shop.example.com in the platform, so the journey stays on your domain and the cookie is shared. If that is not possible, treat the platform address as a separate domain and configure cross-domain measurement for it. The same applies to Meta Pixel: our guide to Meta Pixel cross-domain tracking covers what carries over and what does not.
How to see each subdomain in GA4 reports
GA4 records the subdomain on every page view in the Hostname dimension, which Google defines as the subdomain and domain names of the URL, so www.example.com/contact.html has the hostname www.example.com. It is filled in automatically from the page URL. The catch is that Page path and screen class, the path option in the Pages and screens report, holds only the part after the domain, so /pricing on www and /pricing on app land in one row. There are three ways to separate them.
Add Hostname to Pages and screens
Open Reports, then Engagement, then Pages and screens. Next to the dimension drop-down above the first column of the table, click the plus icon and choose Hostname as a secondary dimension. Each row now shows the path and the subdomain it was viewed on. The secondary dimension is temporary and disappears when you leave the report. For entry pages, the same approach works in the landing page report, described in our GA4 landing page report guide.
Save a comparison per subdomain
Comparisons put subdomains side by side in any report. Click the comparison icon at the top right of a report, then Create new, choose Hostname as the dimension, set the match type, pick a value such as app.example.com and click Apply. A property can store up to 200 saved comparisons. Saving one needs the Editor role or above, and anyone with access to the property can then apply it. Applied comparisons are deselected when you move to another report page, so turn them back on from the control next to All users.
Build an exploration by hostname
For a lasting view, go to Explore and start a Free form exploration. In the Variables panel, click the add icon beside Dimensions, select Hostname and Session source / medium, click Import, and do the same for metrics such as Sessions and Key events. Drag Hostname into Rows to see traffic and results per subdomain, or add up to four segments to compare groups of visitors.
Hostnames you did not expect
Once Hostname is in a report, sort by it and look for values that should not be there. Common ones are a staging or preview subdomain loading the production tag, a builder address such as brand.webflow.io still receiving visits, and a subdomain you had forgotten existed, like an old events microsite. Staging traffic is best stopped at the source by removing the production ID from that environment; our guide to excluding internal traffic in GA4 covers the filters for your own team's visits.
A five-minute test across two subdomains
- 1Open a private window and visit www.example.com with a test campaign, for example ?utm_source=test&utm_medium=test&utm_campaign=subdomain-test.
- 2Open Chrome DevTools, go to Application, Storage, Cookies, select the site and find _ga. Note its Value and check the Domain column shows example.com (it may be written with a leading dot, .example.com), not www.example.com. A cookie set on example.com can be read on every subdomain.
- 3Click a normal link to the other subdomain, such as app.example.com or help.example.com.
- 4Check _ga again on the second subdomain. The value should be identical. A different value, or a second _ga cookie with a prefix, means that subdomain is not sharing the cookie.
- 5In DebugView, with debug mode on, confirm events from both subdomains appear under the same device. The GA4 DebugView guide explains how to turn it on.
- 6The next day, build the exploration above filtered to the subdomain-test campaign and confirm sessions on both hostnames are credited to test / test, not to your own domain as a referral.
To confirm the same IDs are present before you test, run one page from each subdomain through the pixel inspector. It lists the GA4, Google Tag Manager and Meta Pixel IDs in each page's initial HTML. It cannot see tags that Google Tag Manager injects later, so for a GTM setup, check the container's tags as well.
Frequently asked questions
Should each subdomain get its own GA4 property or data stream?
Usually not. Google's account structure guidance recommends a single web data stream to measure the web user journey, and one stream can cover several domains. Separate properties split users and sessions at every subdomain boundary. Keep one property and stream, then use the Hostname dimension to look at each subdomain on its own.
Why does the same page path show double the views I expected?
Page path and screen class excludes the hostname, so /pricing on www.example.com and /pricing on app.example.com are counted in the same row. Add Hostname as a secondary dimension to split the row by subdomain, or use Page location, which holds the complete URL including the subdomain, in an exploration.
Can I hide a staging subdomain from my reports?
The cleanest fix is to stop the production measurement ID loading on staging at all, for example by removing it from the staging build or using a separate test property. For data already collected, add a report filter or comparison on Hostname that excludes the staging address. Filters added in a report do not delete anything from the property.
Sources
Try EndFrame
Add a server-side path for your conversions.
EndFrame collects events first-party and forwards conversions server-side to Meta, GA4, TikTok, and webhooks with event-ID deduplication — then credits each conversion to its campaign, with the visit-to-conversion path you can audit.
No credit card required