Subdomain Tracking in Google Analytics 4 (GA4) & GTM: Complete Setup Guide

| Incisive Ranking

If your website uses multiple subdomains like:

  • blog.yoursite.com
  • shop.yoursite.com
  • app.yoursite.com

Then one question becomes critical:

👉 Are you tracking users correctly across all of them?

Because if not, your data may show:

  • Duplicate users
  • Broken sessions
  • Incorrect attribution

The good news?

GA4 makes subdomain tracking much easier than before.

In this guide, you’ll learn:

  • How subdomain tracking works in GA4
  • Whether you need to configure anything
  • Step-by-step setup
  • Common issues and fixes

What Is Subdomain Tracking?

Subdomain tracking means measuring user behavior across different subdomains under the same main domain — as one continuous journey.

Example:

User flow:

  • Visits → blog.example.com
  • Then → shop.example.com
  • Then → checkout

👉 Ideally, this should be tracked as one session, one user, one journey

Without proper tracking, GA4 might treat this as multiple users or sessions — breaking attribution.

Good News: GA4 Tracks Subdomains Automatically

Unlike Universal Analytics, GA4 handles subdomain tracking out of the box.

👉 As long as:

  • You use the same GA4 Measurement ID
  • Tracking is installed on all subdomains

GA4 will track users across subdomains correctly.

Why This Works

GA4 uses first-party cookies that are shared across subdomains.

So when a user moves from:

  • blog.example.com → shop.example.com

The same cookie is used, keeping:

  • User identity
  • Session continuity

Step-by-Step: How to Set Up Subdomain Tracking

Even though it’s automatic, you still need to configure things correctly.

Step 1 — Use the Same GA4 Measurement ID Everywhere

This is the MOST IMPORTANT step.

👉 Install the same GA4 tag on:

  • Main domain
  • All subdomains

❌ Wrong:

  • Separate GA4 properties for each subdomain

✅ Correct:

  • One GA4 property
  • One data stream
  • One Measurement ID

 Show GA4 Measurement ID in Admin → Data Stream

Step 2 — Install GTM on All Subdomains

Make sure your Google Tag Manager container is present on:

  • blog.yoursite.com
  • shop.yoursite.com
  • main site

👉 Without GTM installed, no data will be tracked.

Step 3 — Verify Cookie Sharing

Open browser developer tools:

  • Go to Application → Cookies
  • Look for _ga cookie

👉 Check:

  • Cookie domain = .example.com
  • Same value across subdomains

This confirms GA4 is tracking users correctly.

Step 4 — Test in GA4 DebugView

  • Enable Preview mode in GTM
  • Navigate across subdomains
  • Open GA4 → DebugView

👉 You should see:

  • One user session
  • Continuous event flow

Step 5 — Fix Self-Referral Issues (If Needed)

Sometimes GA4 shows your own subdomain as a referral source.

👉 Example:

  • blog.example.com → referral

This breaks attribution.

Fix:

Go to:

  • Admin → Data Streams
  • Configure Tag Settings
  • List unwanted referrals

Add:

example.com

This prevents self-referrals.

Show referral exclusion settings

How to View Subdomain Data in GA4

Here’s where many marketers get confused.

By default, GA4 doesn’t clearly show subdomains.

Method 1 — Use “Hostname” Dimension

  • Go to Reports
  • Add secondary dimension → Hostname

👉 This shows:

  • blog.example.com
  • shop.example.com

Method 2 — Use Page Location

This shows full URLs including subdomains.

Example:

https://blog.example.com/article

Method 3 — Create Custom Reports

Best approach for clarity:

  • Go to Explore
  • Add dimension: Hostname
  • Add metrics: Users, Sessions

👉 This gives full subdomain performance view

Common Subdomain Tracking Mistakes

❌ Using Different GA4 Properties

This causes:

  • New sessions when switching subdomains
  • Broken attribution

❌ Not Installing GTM on Subdomains

No tag = no tracking

❌ Seeing Self-Referrals

Fix with referral exclusion list

❌ Different Cookie Values

This indicates:

  • Incorrect setup
  • Separate measurement IDs

When You DO Need Cross-Domain Tracking

Important clarification:

👉 Subdomains ≠ Cross-domain tracking

You only need cross-domain tracking when:

  • example.com → differentdomain.com

Subdomains are handled automatically in GA4.

Real-World Insight (From Marketers)

A common issue seen in practice:

Tracking works in GTM… but not in GA4

This usually happens because:

  • GA4 Measurement ID is missing on subdomain
  • Or different properties are used

Best Practices for Subdomain Tracking

✔ Use one GA4 property
✔ Use one data stream
✔ Install GTM everywhere
✔ Test with DebugView
✔ Monitor referrals
✔ Use hostname in reports

Final Thoughts

Subdomain tracking in GA4 is much simpler than before — but only if implemented correctly.

Most issues don’t come from GA4 limitations…
👉 They come from setup mistakes.

When configured properly, GA4 gives you:

  • Unified user journeys
  • Accurate attribution
  • Better conversion insights

And that’s exactly what modern marketing depends on.

👉 “Struggling with tracking across subdomains? At Incisive Ranking, we help businesses implement clean, accurate GA4 and GTM setups that actually reflect real user journeys.”

Follow Us:

About Us

We are experts in Tags and Tracking Services. With experience in eCommerce and Custom Conversion tracking, Server Side Tagging, and Data tracking to help you get the advantage of ACCURATE data for better decision making. With more than 6 years of experience, We have already delivered more than 500 projects.