Subdomain Tracking in GA4: What You Need to Know

GA4 handles subdomains automatically. When to use cross-domain tracking, how to avoid self-referrals, and how to configure your data stream correctly.

Subdomain tracking is one of the most frequently asked questions in GA4 configuration. The good news: GA4 greatly simplifies things compared to Universal Analytics. The bad news: configuration errors remain common and cause artificially split sessions and distorted traffic sources.

GA4 Handles Subdomains Automatically

Unlike Universal Analytics, which required explicit cookie domain configuration, GA4 uses the cookie_domain parameter in auto mode by default. Concretely, the _ga cookie is set on the root domain (.example.com) rather than the specific subdomain (blog.example.com). This behavior means a user navigating from www.example.com to blog.example.com then to shop.example.com retains the same client ID throughout their session.

You need only a single data stream and a single measurement ID deployed across all your subdomains. No additional configuration, no cross-domain tracking.

Cross-Domain Is Not Needed for Subdomains

This is the most frequent mistake: enabling cross-domain tracking between www.example.com and shop.example.com. Cross-domain tracking is designed to link completely different domains (example.com to checkout-provider.com). Enabling it between subdomains of the same root domain is not only unnecessary but can create problems with _gl parameters in URLs.

Cross-domain tracking becomes necessary only when the user moves from one root domain to another: for example, your main site on yoursite.com and your payment tunnel on stripe-checkout.com.

The Self-Referral Problem

Even with correct cookie configuration, you may observe self-referrals in your reports. A self-referral appears when your own domain or subdomain shows up as a traffic source. This typically happens when a subdomain uses a redirect system that regenerates the session.

The solution is in GA4 admin: Data Stream, then Configure Tag Settings, then List unwanted referrals. Add your root domain (example.com) with a “contains” condition. All subdomains will be automatically excluded from traffic sources.

Optimal Configuration in Practice

For a clean GA4 setup on a multi-subdomain environment, here is the checklist:

  • Deploy the same measurement ID on all subdomains
  • Verify that the _ga cookie is set on the root domain (Application tab in Chrome DevTools)
  • Add your root domain to the unwanted referrals list
  • Do not enable cross-domain tracking between subdomains
  • Test session continuity by navigating between subdomains with GA4 debug mode

When Cross-Domain Is Actually Needed

Cross-domain tracking is justified in only one case: the user leaves your root domain for a completely different domain you control. Classic examples include a brochure site on yourcompany.com with a shop on yourstore.com, or a form hosted on a third-party domain. In these cases, enable cross-domain in Configure Tag Settings and add the relevant domains. For any questions about GA4 configuration or GA4 fundamentals, our resources are at your disposal.

Need help with this topic?

I can help you implement or optimize your tracking setup.

Book a call