Analytics and Tracking

Subdomain Tracking

Also called Sub-domain measurement

Measuring visits that move between subdomains of one site as a single journey rather than separate visits.

Quick facts: Subdomain Tracking

Category
Analytics and Tracking
Also called
Sub-domain measurement
Level
Intermediate
Affects
Session counts, traffic source accuracy, conversion credit
Where to see it
GA4 data streams, Google Tag Manager, hostname dimension in reports
In this article4
  1. How subdomain tracking works
  2. Why subdomain tracking matters
  3. Where subdomain tracking goes wrong
  4. What to do about it

How subdomain tracking works

A subdomain is a name in front of your main domain: a shop, a blog, a booking system or a help centre living at its own address while still belonging to the same registered domain. Analytics treats these as one site as long as two conditions hold. The same measurement ID must be installed on every subdomain, and the cookie that identifies the visitor must be written at the level of the main domain rather than at the level of each subdomain.

Google Analytics handles the second part by default. The tag writes its cookie on the highest level of the domain it can, so a visitor who moves from the blog to the shop carries the same identifier and stays in the same session. Nothing extra needs configuring for the common case, which is exactly why the situations where it fails catch people out.

Why subdomain tracking matters

When it works, one journey reads as one journey: the visitor arrived from a search result on the blog, moved to the shop and bought, and the sale is credited to search. When it breaks, the same journey is recorded as two visits, the second one arriving from your own website, and the sale is credited to the blog instead of to the channel that actually earned it. Every channel report downstream inherits that error.

It also decides whether you can answer basic questions about how sections of the site work together — whether the help centre reduces cancellations, whether the blog feeds the shop — and those questions are usually the reason a subdomain existed in the first place.

Where subdomain tracking goes wrong

The most common fault is a subdomain built by a different supplier at a different time, carrying either no tag at all or a tag with its own measurement ID. Traffic then splits between properties and the join is impossible to reconstruct later.

The next is a platform that will not let you control cookie settings, which is typical of hosted booking engines, help desks and shop platforms on their own subdomain. If such a system writes the cookie only at its own level, the visitor is treated as new on arrival and you get a self-referral from your own domain.

A third is reporting confusion rather than collection failure. Without the hostname in your reports, identical page paths on two subdomains stack on top of each other and you cannot tell which one the traffic went to.

What to do about it

Start by listing every subdomain that exists, including staging sites and systems a department bought without telling anyone. Confirm each carries the same measurement ID, then walk the journey yourself between subdomains and check that the session continues rather than restarting.

Add hostname as a dimension in your key reports, or build a custom report grouped by it, so path collisions become visible. Where a hosted platform refuses to cooperate, list it as an unwanted referral so it does not overwrite the original source. If the subdomain is on a genuinely different registered domain, this is a different problem and needs cross-domain tracking instead. The choice between putting a section on a subdomain or in a folder also has search consequences, covered under subdomain vs subfolder.

Do and do not

Do

  • Install the same measurement ID on every subdomain
  • Add hostname to your main reports
  • Walk the journey yourself and watch the session continue

Do not

  • Set up cross-domain tracking for subdomains of one domain
  • Let a hosted platform run its own separate property
  • Forget staging subdomains when you audit tags

Questions people ask about this

Do I need cross-domain tracking for my subdomains?

No, not if they share the same registered domain. Analytics writes its cookie at the top level of that domain, so movement between subdomains keeps the same visitor and session automatically. Cross-domain configuration is for genuinely different domains, such as a separate booking site or a payment provider on its own web address.

Should the shop and the blog be separate analytics properties?

Usually one property serves you better, because the value of the blog is often that it feeds the shop, and separate properties make that impossible to see. Use one property and separate the sections by hostname in reports. Split into separate properties only when they are genuinely different businesses with different teams and different goals.

Why does my subdomain show up as a referral to itself?

Because the tag on that subdomain is not sharing the visitor identifier with the rest of the site. It may be a different measurement ID, a missing tag, or a hosted platform writing its cookie only at its own level. Check the tag first, and add the domain to your unwanted referrals list while you fix the cause.

Related terms

Found this useful?

Share it, or ask an AI to summarise it

Back to the glossary

Knowing the term is the easy part

Applying it to your own site and budget is the work. Book a call and I will tell you what actually applies to you.