How to Exclude Subdomains from Google Analytics

Cody Schneider7 min read

Ever notice traffic from 'blog.yourwebsite.com' in your Google Analytics reports showing up as a “referral”? This is a sign that your data might be misleading. When a user moves from your main site to a subdomain, Analytics can mistakenly count it as a new session from a new source, breaking the user journey in half and skewing your attribution data. This guide will walk you through exactly how to fix this by excluding your subdomains in both Google Analytics 4 and Universal Analytics, ensuring your data accurately reflects how users interact with your entire website.

GraphedGraphed

Your AI Data Analyst to Create Live Dashboards

Connect your data sources and let AI build beautiful, real-time dashboards for you in seconds.

Watch Graphed demo video

Why Accurate Subdomain Tracking Is So Important

Most businesses don't live on a single root domain. You might have your main site at yourwebsite.com, your blog at blog.yourwebsite.com, and your e-commerce store at shop.yourwebsite.com. From your perspective, this is all one unified business property. But by default, Google Analytics might see them as separate entities talking to each other.

Imagine a user lands on one of your blog posts from a Google search, reads it, and then clicks a "Shop Now" button that takes them to your shop subdomain. If your subdomains aren't excluded correctly, a few things happen that mess up your data:

  • Inflated Session Counts: Instead of tracking one continuous session, GA closes the first session on the blog and starts a brand new one on the shop. One visitor journey suddenly looks like two separate visits.
  • Incorrect Attribution: In the scenario above, the second session's source would be new attribution. GA would report that the purchase on shop.yourwebsite.com came from a "referral" from blog.yourwebsite.com, completely losing the original source, which was organic search. This makes it impossible to know which of your top-of-funnel channels are actually driving conversions.
  • Fragmented User Journey Data: You lose the ability to see the complete path a user takes, from discovery to conversion. Behavior Flow reports become disjointed and difficult to interpret. You can’t tell that the blog post was the critical first touchpoint that led to a sale.

Fixing this is not just a technical tweak, it's fundamental to understanding your marketing performance. You need to tell Google Analytics, “Hey, all of these subdomains are part of the same family. Treat any movement between them as internal traffic, not as external referrals.”

Free PDF Guide

AI for Data Analysis Crash Course

Learn how to get AI to do data analysis for you — the best tools, prompts, and workflows to go from raw data to insights without writing a single line of code.

Step 1: Identify Your Subdomains

Before jumping into Analytics settings, you first need to confirm you have a self-referral problem and compile a list of all your subdomains. A quick way to check this in GA4 is to look at your referral traffic report.

  1. Navigate to Reports in the left-hand navigation.
  2. Go to Acquisition > Traffic acquisition.
  3. In the table, find the primary dimension dropdown (it usually defaults to "Session default channel group") and change it to Session source.
  4. Scan the list of sources for any of your own subdomains (e.g., blog.yourwebsite.com, app.yourwebsite.com).

If you see your own domains on this list, you've confirmed that GA is treating them as external referral sources. You'll need to follow the steps below to fix it.

Some common subdomains that marketing and sales teams use include:

  • Content Hubs: blog.yourdomain.com, resources.yourdomain.com
  • E-commerce Stores: shop.yourdomain.com, store.yourdomain.com
  • Web Applications: app.yourdomain.com, secure.yourdomain.com
  • Support & Community: help.yourdomain.com, support.yourdomain.com
  • Landing Pages: go.yourdomain.com, offers.yourdomain.com

How to Exclude Subdomains in Google Analytics 4

Google Analytics 4 is much better at automatically detecting and handling subdomain tracking than its predecessor, Universal Analytics. However, the one crucial step to prevent self-referrals is to configure your "unwanted referrals" list. It’s a simple process that ensures movement between your properties is seamless.

Add Your Domain to the Referral Exclusion List

This setting tells Google a traffic isn't coming from an external site even if they are technically coming from another domain (like your own subdomain).

Here’s the step-by-step process:

  1. Log into your Google Analytics account and navigate to the Admin section by clicking the gear icon in the bottom-left corner.
  2. In the "Property" column, click on Data Streams, then select the relevant web data stream.
  3. Scroll down and click on Configure tag settings under the "Google tag" section.
  4. On the next screen, click Show more if needed, and then select List unwanted referrals.
  5. You'll now see the section "Include referrals from domains that match ANY of the following conditions." Here’s what to do:
  6. Click Save at the top right.

That's it for GA4. By adding your root domain to the unwanted referrals list, you're telling Google to ignore any incoming traffic from a source that contains "yourwebsite.com." This effectively covers all of your existing and future subdomains without needing to list each one individually.

GraphedGraphed

Your AI Data Analyst to Create Live Dashboards

Connect your data sources and let AI build beautiful, real-time dashboards for you in seconds.

Watch Graphed demo video

Instructions for Universal Analytics (UA) Users

Though Google fully transitioned to GA4 in July 2023, many people still refer to their historical UA data or manage older properties. The process in UA is just as straightforward, though found in a different place.

  1. Go to the Admin section of your UA property.
  2. In the "Property" column, find Tracking Info and click on it.
  3. From the dropdown menu, select Referral Exclusion List.
  4. Click the red + ADD REFERRAL EXCLUSION button.
  5. Just like in GA4, enter your root domain (e.g., yourwebsite.com) into the field.
  6. Click Create to save the changes.

This UA setting works the same way: it tells Google to ignore any traffic tagged as a referral from any domain that contains the text you added, thereby unifying all subdomain traffic.

Best Practices and Other Domains to Exclude

Properly configuring your subdomains is step one. But the same "unwanted referral" logic applies to other situations where a user temporarily leaves your site and returns as part of a single intended session.

1. Exclude Third-Party Payment Gateways

This is arguably the most common and damaging source of bad referral data, especially for e-commerce or SaaS businesses. When a user is ready to pay, you might send them to an external site like PayPal, Stripe Checkout, or Authorize.net to complete the transaction.

If you don't exclude these domains, what happens? Your happy customer, who originally came from a Facebook Ad, goes to PayPal to pay. After they've paid, PayPal redirects them back to your "Thank You" page. In GA's eyes, this comeback from PayPal is a new session with paypal.com as the referral source. Your conversion is now incorrectly attributed to PayPal instead of that original Facebook Ad.

To fix this, add the domains for any payment gateways you use to your "List unwanted referrals" in GA4. Common ones include:

  • paypal.com
  • checkout.stripe.com
  • authorize.net

Free PDF Guide

AI for Data Analysis Crash Course

Learn how to get AI to do data analysis for you — the best tools, prompts, and workflows to go from raw data to insights without writing a single line of code.

2. Exclude Third-Party Booking or Login Tools

The same logic applies to any external tool that your user interacts with before being sent back to your site. This could be a tool for booking appointments, buying event tickets, or using a third-party login service.

For example, if you use a registration tool like Eventbrite, you should exclude eventbrite.com. If you use a scheduling tool, you might exclude calendly.com.

3. Remember: Changes Are Not Retroactive

It’s important to understand that any changes you make to your Referral Exclusion List will only apply to data collected from this point forward. It will not fix your historical data. That's why setting this up correctly from the very beginning is so important for data hygiene. Once you implement the fix, you can create an annotation in GA to mark the date so you know when clean data began tracking.

Final Thoughts

Excluding your subdomains and relevant third-party apps from your referral list is a small configuration change with a huge impact on data accuracy. It ensures your attribution models are correct, session data is unified, and you have a clear, end-to-end view of how users truly interact with your business online.

Getting your GA settings cleaned up is a great first step, but it often highlights a bigger challenge: your essential data is scattered across Google Analytics, Facebook Ads, Shopify, HubSpot, and a half-dozen other platforms. We spent years of our careers manually copying data into spreadsheets just to build basic performance reports. That's precisely why we built Graphed . It seamlessly connects all your favorite marketing and sales tools, letting you create dashboards and pull insights using simple, natural language - no more data wrangling.

Related Articles