Skip to content

Guide 139 · Setup · GA4 + Tag Manager

Track subdomains in GA4: one property, one Measurement ID, no cross-domain setup

Checked 11 November 2026 · Verification: subdomain consistency checked (1 property, 1 stream, 1 Measurement ID across 3 subdomains) · Steps traced to Analytics Help, read 11 November 2026 · 5-minute read

Subdomains are the case where GA4 does the work for you. The analytics cookies are written at the root domain by default, so www.example.com, blog.example.com, and shop.example.com all read the same cookie and the same client ID. The only job is consistency: the same property and the same web data stream on every subdomain. This guide checks that consistency and shows how to tell the subdomains apart in the reports.

Expected signal

After step 3, a visitor moving from www to blog to shop stays one user in one session, and the Hostname dimension separates the three subdomains in the reports.

Download the reference: the subdomain tracking reference (JSON) (822 bytes, MD5 41dceb71ddb9b489efd77a3c6adb2185). The subdomain setup from Google's help pages, with the consistency check recomputed: 3 subdomains share 1 Measurement ID.

What you need

  • A GA4 property with one web data stream. Every subdomain uses the same stream and the same Measurement ID.
  • The Google tag installed on every subdomain. The same tag ID on each one — the tag is what reads and writes the root-domain cookie.
  • Access to the tag on each subdomain. One install method across all of them, whether that is the snippet, Tag Manager, or a plugin.

The trace

  1. Use one property and one stream for all subdomains. Do not create a separate data stream for each subdomain. One website's subdomains belong in one property and one web data stream, so all of them share the same Measurement ID.
  2. Install the same tag on every subdomain. Put the Google tag with that Measurement ID on www, on the blog, and on the shop. The tag on each page must use the same tag ID from the same web data stream — the same requirement cross-domain measurement states, applied inside one domain.
  3. Check the cookie domain is the default. GA4 sets cookies at the highest shared domain by default, which is why subdomains work without extra configuration. In the worked example the site has 3 subdomains — www, blog, and shop — and all 3 share 1 Measurement ID, so the ratio is 3 subdomains to 1 ID. Do not set a custom cookie domain that scopes the cookie to a single subdomain; that breaks the sharing the default gives you.
  4. Confirm the journey holds. Visit the main domain, click through to a subdomain, and check the Realtime report: the visit is still one session, not a new one. If the reports show the site's own domain as a referrer, that is a self-referral, and it means a subdomain is tagged differently from the rest.
  5. Split the subdomains in the reports. When the analysis needs the subdomains apart, use the Hostname dimension in the reports to filter or segment by subdomain. The data stays in one property, and the dimension does the splitting.

Dead ends

DEAD END — ADDING SUBDOMAINS TO CROSS-DOMAIN MEASUREMENT BY HABIT. Cross-domain measurement is for different root domains, not subdomains of the same root. Google's cross-domain page recommends the setup for subdomains only when different cookie domains cause self-referrals. Adding every subdomain as a cross-domain condition by default solves a problem that does not exist.

DEAD END — CREATING A STREAM PER SUBDOMAIN. A stream per subdomain means a Measurement ID per subdomain, and a visitor crossing between them starts a new session each time. One stream for all subdomains is the setup the documentation requires.

DEAD END — SCOPING THE COOKIE TO ONE SUBDOMAIN. A custom cookie_domain setting that pins the cookie to www.example.com hides it from blog.example.com. Leave the cookie domain at its default so the cookie is written at the root domain and read by every subdomain.

End state

One property, one web data stream, and one Measurement ID cover the main domain and all its subdomains. Visitors move between subdomains in a single session, self-referrals from the site's own subdomains are gone, and the Hostname dimension splits the traffic when the analysis needs it.

Sources

Checked 11 November 2026. The same-stream requirement and the subdomain note above are the ones in Google's cross-domain measurement page, opened 11 November 2026. No step in this guide was run inside a live Analytics property, because that needs a Google sign-in and this site does not sign in as anyone. The reference file was checked in Python: its figures were recomputed from the documentation values and match the numbers on this page. Google moves menu items without warning; if a path on this page no longer matches, the linked help page is the current map.