Articles

How to set up filters in Google Analytics to track sub-domain performance

Google Analytics is a powerful tool, however, the out of the box capabilities can feel constraining. A common issue that affects our clients is the need to filter sub-domain traffic to gain an understanding of how users are interacting with different sections of their website. A Google Analytics account has the ability to create 25 reporting views, each with its own unique tracking features, qualifiers, or exclusions.

A basic filter alters the data that is presented within a Google Analytics view. It's important to remember when creating a new filter always maintain at least one master view within your account that has undisturbed data. Filters will completely limit the data they are applied to and will negate access to past information outside of their purview.

For a quick tutorial on basic filters watch this video:

Common Google Analytics Sub-Domain Filtering Scenarios

When you create a sub-domain filter it gives you the ability to segment data and analyze sub-domain traffic without creating complicated multi-dimensional reports. There are many situations where this can be applied:

  • Language sub-domain filters
  • Blogs
  • Internal IP address exclusions
  • Knowledgebase & support centers
  • Monitoring unique marketing campaigns
  • Geographic segmentation
  • Landing pages
  • Device patterns for mobile sites
  • Group traffic for specific sub-folders

Setting Up Your Sub-Domain View and Filter

There is a three-step process for creating a sub-domain filter in your Google Analytics account:

  1. Create a new view;
  2. Add unique inclusion or exclusion filters within the view;
  3. Add a sub-domain referral exclusion to property tracking.

Here’s how you start the process...

1. Creating a new Google Analytics View

*You’ll need Account Edit Permissions or higher to perform the following instructions.

After logging into your Google Analytics account, go into your admin panel, which is located at the bottom left-hand side of your screen under ‘Admin’.

Google Analytics Sub Domain Filter Within the Admin panel, there are three panels: Account, Property, and View.

This is the Google Analytics hierarchy. The account acts as an overarching housing unit that can have multiple properties. The properties represent different domains that you track within an account. Each property can have multiple views that are used to segment data based on your applied criteria.

For this sub-domain example, you are going to create a new view, which is found at the top of the far right panel under ‘+ Create View’.

Google Analytics Admin Panel

You’ll have to determine view features like the type of data you want to be tracked; website or mobile application. Once done, apply a view name that is relevant to the data you will be segmenting. Make it something that’s easy to remember, this is the name you’ll see in your account options when looking for your segmented data in the future.

Once finished, click the ‘Create View’ button.

Google Analytics Sub Domain View

2. Creating Google Analytics Filters

After you’ve created your new view, you can begin part two; adding view filters.

Select your newly created view from the account drop-down menu. In the same Admin area, go to the right-hand ‘View’ column and scroll down until you find ‘Filters’.

Google Analytics Filters

You’ll be prompted to create a new filter and given six fields that need to be edited to include your sub-domain traffic. Follow this process step-by-step:

Google Analytics Filter Pattern

  • Choose ‘Create new Filter’

  • Create a descriptive ‘Filter Name’ that is easily identifiable

  • Switch Filter Type to ‘Custom’

  • Change the selected Filter Type to ‘Include’

  • Open the drop-down selector ‘Filter Field’ and choose ‘Hostname’

  • In the ‘Filter Pattern’ text box add the sub-domain you want to track and include backslashes before each period. The general pattern to follow looks like sub-domain\.url\.com.

  • For example, if Bluehouse Group had a sub-domain for Spanish website traffic our filter pattern would look like this: es\.bluehousegroup\.com.

  • Save your new filter.

3. Add a Sub-domain Referral Exclusion

This is the most commonly missed step when segmenting website data in Google Analytics.

Sub-domain traffic is already included in your overall website traffic. When you create a sub-domain filter you don’t want this sub-domain to appear as self-referring traffic on future reports or it will affect your overall website metrics.

To prevent this from occurring, you need to create a referral exclusion in the Google Analytics property admin. Start by returning to the Admin button in the bottom left column of your account.

Google Analytics Sub Domain Filter

From here, you’ll need to make sure that the new sub-domain filter is still selected in the View section. Then, click ‘Tracking Info’ located in the middle Property column. This will expose additional options where you select ‘Referral Exclusion List’.

Google Analytics Referral ExclusionClick on the red 'Add a new referral exclusion' button. Type your sub-domain into the text field (Don’t include the backslashes that were added in the Filter Pattern field while creating the filter) and click create.

You’ve now officially set up a sub-domain filter. You can switch between views within your admin panel or by revealing the drop-down panel in the top left corner of your account. Happy analyzing!