Exclude A Subdomain In Google Analytics

//

Jon Elordi

It’s not uncommon to want to remove a whole section of your website from a Google Analytics view. Luckily we can exclude a subdomain in Google Analytics. Websites often have subdomains for various parts of their websites. Often they are archives, eCommerce stores, or login areas for users. A login area is probably the most common(account.yourwebsite.com). While these are important parts of the site, we wouldn’t necessarily need them in a Google Analytics view.

Create a filter

To get started, Go to View settings and click on “filters.” Once you’re in filters click on “ADD FILTER.”

create a filter google analytics

Once you’re in the create a filter screen select the appropriate settings.

configure filter in google analytics
  1. Create a new filter
  2. Give the filter a name example: “Remove Account Subdomain”
  3. Select Predefined
  4. Select “Exclude”
  5. Select “traffic to the hostname”
  6. Select “that contain”
  7. Input the hostname you are trying to exclude from the Google Analytics view. Example: account.yourwebsite.com
  8. Click “Save”

And you’re done. that’s how you exclude a subdomain from Google Analytics

Things to keep in mind

  • Filters are not backward-looking. The filter only applies to new data that comes in after implementing the filter. The filter will not be applied to past data. This is why it is important to have a backup view that contains all the raw data.
  • Filters are unforgiving. Filters will block all new incoming data, and there is no way to get it back. If there is a typo in your filter this can be problematic. So it is best practice to test your filters for a given amount of time before implementing them. And again, have a backup view that contains all the raw data.
  • After you implement the filter, traffic from that subdomain will come in as a referral. If this is a problem you can use referral exclusion as a way to counteract that.
  • If you switch the “exclude” to “include” you can create a view that only looks at traffic on those subdomains. This can be a helpful strategy in organizing your data.

To learn more about filters, I suggest the Google Analytics official documentation. If these terms are a bit advanced for you I recommend checking out my Google Analytics glossary or you can download my free Google Analytics eBook to learn more.