Does Google Analytics Track Subdomains?

Cody Schneider7 min read

The short answer is yes, Google Analytics absolutely tracks subdomains. How it accomplishes this has changed significantly with Google Analytics 4, making the process much more straightforward than it once was. This article will walk you through how GA4 handles subdomain tracking automatically, how to verify it’s working correctly, and why getting this right is so important for understanding the complete journey your visitors take.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

How Subdomain Tracking Works in Google Analytics 4

If you're using Google Analytics 4, you’re in luck. GA4 was designed from the ground up to provide a more unified view of the user journey, and that includes tracking across subdomains without any special configuration. It just works automatically, as long as you use the same GA4 Measurement ID across all of your sites.

In the past, with Universal Analytics (UA), you had to make a specific configuration change to enable cross-subdomain tracking. It was a common pain point that required developers to set a field called cookieDomain to a value of 'auto' in the tracking code. This told UA to set the tracking cookie on the highest-level domain possible (e.g., .yourwebsite.com instead of just www.yourwebsite.com).

GA4 simplifies this entirely. By default, the GA4 tracking cookie (_ga) is automatically set on the top-level domain. This single change is what allows for seamless tracking between your main site and its subdomains.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

A Practical Example

Let's say your business uses a few different web properties:

  • Main Marketing Site: yourcoolbrand.com
  • Blog: blog.yourcoolbrand.com
  • Online Store: shop.yourcoolbrand.com
  • Support Center: help.yourcoolbrand.com

When a visitor lands on blog.yourcoolbrand.com, GA4 sets a cookie for the parent domain, .yourcoolbrand.com. If that same visitor later clicks a link to visit shop.yourcoolbrand.com, their browser presents that same cookie. Google Analytics recognizes it as the same user, continuing their session without interruption.

To your analytics, this entire journey - from a blog post to a product page to a support article - is viewed as a single, continuous experience by one user. This prevents data fragmentation and gives you a true picture of how people navigate your digital ecosystem.

How to Verify Your Subdomain Tracking is Working

While GA4 is great at handling this automatically, it's always smart to verify that everything is working as expected. Trust, but verify. Here are two simple methods to double-check your setup.

1. Use the Real-time Reports

The Real-time report is your best friend for live debugging. It lets you see activity on your site as it happens.

  1. Open your GA4 property and navigate to Reports > Real-time.
  2. In a separate browser window (preferably an incognito one to avoid having your own activity filtered), visit your main domain (e.g., yourcoolbrand.com). You should see yourself show up in the Real-time report as one active user.
  3. Now, in the same browser tab, navigate to one of your subdomains (e.g., blog.yourcoolbrand.com).
  4. Watch the Real-time report. The key here is that the "Users" count should not increase. You should still be counted as the same single user, but you’ll see new events like page_view and user_engagement fire for the subdomain page you’re now on.

If the user count stays at 1 as you move between your domain and subdomain, your cross-subdomain tracking is working perfectly.

2. Check Your Engagement Reports

Once you have a day or two of data, you can confirm that traffic from all subdomains is filtering into the same report.

  1. In your GA4 property, go to Reports > Engagement > Pages and screens.
  2. By default, this report shows you data by "Page path and screen class," which is the part of the URL that comes after the domain (e.g., /pricing or blog/my-latest-post).
  3. To see the subdomain, you need to add a secondary dimension. Click the blue + icon next to the primary dimension dropdown.
  4. In the search box, type "Hostname" and select it from the "Page / screen" category.

And there you have it! The report will now update to show you two columns: "Hostname" and "Page path." You should clearly see your domains and subdomains listed in the "Hostname" column (e.g., www.yourcoolbrand.com, blog.yourcoolbrand.com, shop.yourcoolbrand.com), confirming that GA4 is collecting all of this data in a single property.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Common Subdomain Tracking Pitfalls (and How to Fix Them)

Even with GA4's improved setup, a few configuration mistakes can still cause problems. Here are the most common issues to look out for.

Problem 1: Using Different Measurement IDs

This is the most frequent mistake. If your blog has one GA4 tracking code (e.g., G-ABC1234567) and your main site has another (G-XYZ9876543), Google Analytics considers them two completely separate websites. Data will flow into two different properties, and user journeys will be fragmented.

The Fix: Audit every page of your domain and all subdomains to ensure they are all using the exact same GA4 Measurement ID. Whether you're using Google Tag Manager or placing the gtag.js script directly on your pages, the ID must be identical everywhere.

Problem 2: Subdomains Showing as Referrals

The entire point of cross-subdomain tracking is to avoid what’s called a "self-referral." A self-referral happens when your own domain or subdomain shows up as a traffic source, which breaks the user session and credits the conversion to the wrong source.

For example, if a user starts on blog.yourcoolbrand.com and clicks to yourcoolbrand.com to sign up, you want the original traffic source (e.g., "Organic Search") to get the credit. If blog.yourcoolbrand.com shows up as the referrer, you've lost the original attribution data.

GA4 is designed to prevent this by automatically adding your domain to a "list of unwanted referrals." However, it’s worth checking this setting if you suspect a problem.

How to Check:

  1. Go to the Admin section of GA4 (the gear icon in the bottom-left).
  2. Under the "Property" column, click on Data Streams and select your web stream.
  3. Click on Configure tag settings at the bottom.
  4. On the next screen, click Show all, and then select List unwanted referrals.
  5. Here, ensure the "Referral domain contains" matching condition includes your top-level domain (e.g., yourcoolbrand.com). You don't need to add every single subdomain, adding the parent domain covers all of them automatically.

If that rule is correctly in place, GA4 will ignore traffic between your subdomains as referral traffic, preserving the original attribution source.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Why Is Accurate Subdomain Tracking So Important?

Setting this up correctly isn't just a technical exercise, it has a major impact on your business decisions. Here’s why it matters so much:

  • Understanding the Full Customer Journey: Most user journeys aren't linear. A customer might discover your brand through a blog post, explore features on your main site, check pricing, and finally make a purchase on your shop subdomain. Without connected tracking, you'd only see isolated parts of this journey, making it impossible to see what's actually effective.
  • Accurate Marketing Attribution: Correct tracking ensures that the credit for a sale or lead goes to the original marketing touchpoint. This helps you properly evaluate the ROI of your advertising campaigns, SEO efforts, and content marketing so you can invest your budget where it will have the greatest impact.
  • Superior Audience and Segment Creation: When all your data lives in one place, you can build smarter, more targeted audiences for remarketing. For instance, you could create an audience of users who read three articles on your blog but didn't visit your pricing page, and then target them with ads showcasing a product demo.

Final Thoughts

So, does Google Analytics track subdomains? Yes, and with GA4, it's easier than ever. The system is designed to handle it automatically, giving you a full picture of your visitor activity across your entire web presence, as long as you deploy the same Measurement ID everywhere. Always take a few minutes to verify your setup in the Real-time and Engagement reports to be certain you're capturing clean, reliable data.

Putting all your analytics under one roof is a massive first step. But even with everything configured perfectly, pulling cross-platform insights can feel like finding a needle in a haystack. We built Graphed to simplify this process. After connecting Google Analytics, you can ask plain-English questions like "What are my top landing pages on the blog subdomain?" or "Create a funnel showing users who started on my main site and purchased on my shop subdomain last month." We turn your questions into instant visualizations and dashboards, so you can spend less time wrangling reports and more time acting on the insights.

Related Articles