Google Analytics: How to filter your subdomain metrics

Blog Header (1)

Google Analytics: How to filter your subdomain metrics

A common scenario that requires you to set up views and filters in Google Analytics, is when multiple subdirectories, subdomains and/or hostnames share the same tracking ID. Most likely you’ll have an e-commerce shop, blog etc. for which you want to have separate views to avoid manual filter work from a master view. That’s when Google Analytics’ views and filters come in handy – and here’s a step-by-step guide that’ll help you view your subdomains’ performance easily.


Step 1: Create a Master View

First things first: You must have a master view. A master view tracks the performance of both root and subdomain and combines the metrics collected into one single view. In order to create a master view, both subdomain and root domain must share the same Tracking ID. DO NOT add a filter to your master view. If you add a filter to the master view, you’ll lose data. Just rename the view that currently tracks both your root and subdomain traffic by selecting:

  1. Admin
  2. Select the property you want to apply views and filters to (it should be selected by default, since you’re already looking at it)
  3. The view column might have a name like “All Web Site Data” – in that case you just have to click on “View Settings” and rename “View Name” into “Master View”. Don’t forget to save your settings.
  4. Refresh

?? That’s it – you’ve successfully completed Step 1.



Step 2: Create a Subdomain View

In this step we are going to create a separate view from your master view that enables you to easily view your subdomain metrics. Let’s start by selecting: 

  1. Admin (if you’re already in the Admin panel, just ignore this step)
  2. Select the appropriate property (again, this should be selected by default, since you’re already looking at the Master View and/or are already working with this property
  3. In the view panel, which should now reflect the new view name “Master View”, click on the blue button “+ Create View”



4. Give the “Reporting View Name” a descriptive name so that you and others are able to understand what this view is about – e.g. “Blog”

5. Add your time zone

6. Save your settings by clicking “Create View”



You should now see below the blue “+ Create View” button the new view you’ve just created:



Only if you see the view you’ve just created, proceed with the following:

7. Select Filters

8. Click on “+ ADD FILTER”

9. Give the Filter Name a descriptive name such as “Blog View Only”

10. Filter Type

10.1 Custom

10.2 Include

10.3 Filter Field = Hostname

10.4 Filter Pattern = blog\.example\.com

11. Save



?? Congratulations! You’ve just set up a Google Analytics subdomain filter in form of a view that reflects only your subdomain (e.g. blog) metrics. Don’t forget to test it by sending some traffic to your subdomain. You should now see subdomain traffic in your master view and exclusively subdomain traffic in the recently created subdomain view.


Step 3: Create a View without Subdomain (optional)

Finally, you might also want to set up a separate view that excludes your subdomain (e.g. blog) traffic. In that case you have to follow the exact structure as depicted in “Step 2: Create A Subdomain View” – with only one small but significant difference in phase 10.2. Go to:

  1. Admin
  2. Select Property
  3. Click on “+ Create View”
  4. Create a “Reporting View Name” e.g. “Online Store”
  5. Add your time zone
  6. Click “Create View”
  7. Next, make sure the view you’ve just selected shows up below the button “+ Create View”, then go to “Select Filters”
  8. Click on “+ ADD FILTER”
  9. Assign a descriptive name to “Filter Name” such as “Online Store Only”

Phase 10.2 is slightly different, as you have to exclude the subdomain from your view: 

10. Filter Type

10.1 Custom

10.2 Exclude

10.3 Filter Field = Hostname

10.4 Filter Pattern = blog\.example\.com

11. Save



?? Perfect! Now you have a view that tracks everything but your subdomain (e.g. blog) traffic.


Step 4: Add Referral Exclusions

This step prevents the subdomain from showing up as self-referral traffic. In order to add referral exclusions, just go to:

  1. Admin
  2. Select property
  3. In the property section, select “Tracking Info”
  4. Select “Referral Exclusion List” of the “Tracking Info” drop-down options
  5. Create a referral exclusion by clicking “+ Add Referral Exclusion”
  6. Add e.g.
  7. Save your settings by clicking “Create”





Step 5: Final Check – All Set?!

You should now have three views:

  1. A Master View,
  2. An exclusive Subdomain View (e.g. blog view), and
  3. A Master View without subdomain traffic

You can go on and create up to 25 views to get more detailed traffic in a matter of a click without manual filtering.

I hope this article helped you breaking down your traffic by creating Google Analytics subdomain filters and views. Still having trouble?! Comment your question and I’ll get back to you as soon as possible!




Leave a Comment