Google Analytics Filters: Why They’re Important And 5 Examples

Add excerpt

Filters in Google Analytics help you to refine your data, so you can better analyse your performance and make better decisions.

Specifically filters in GA help you to exclude data you don’t want to see or include small subsets of data that you want to focus on.

For example, if you were a local business with a blog, you will be attracting interstate and international visitors that will not be interested in your core product or service – So you can filter them from your traffic to get a better representation of what your target audience is doing. But perhaps the most widespread use is to exclude internal traffic, so that you and your team’s visits do not distort your data.


Why are filters important?

Google Analytics filtersLet’s continue looking at internal traffic. If you have a site that gets 50 users each day on average, it might not sound that bad to have one or two staff browsing the site and their behaviour being tracked.

But let’s have a quick look at what that does to a couple of your other metrics.

Internal Traffic Impacting Average Time On Site

We like tracking time on site because it gives you an indication of how well your site is engaging your users.

Let’s imagine that 49 of your users spent an average of one minute and you spent 30 minutes. That’s 79 minutes in total and you divide this by 50 to calculate the average, which is 1.58 or 1 minute and 35 seconds. Filter your traffic and you know your users spend 1 minute, don’t filter and you think they spend 1 minute 35 seconds. Does that change your opinion or decisions?

Internal Traffic Impacting Pages Per Session

Using the same hypothetical 50 users but this time three of the users were your staff – everyone browsing just a single session. The 47 users browsed on average 1.2 pages, which by any measure is going to be a little disappointing. You and your two staff assessing your site’s content and experience browsed 18 pages each. Filter your traffic and you know that your users are only browsing 1.2 pages per session, while if you don’t filter you think they are browsing 2.2. How does that change your perception? Do you ignore an underlying issue?


Understanding Your Google Analytics Account Structure

Google Analytics account, property and view

If you’re not familiar with your Google Analytics account structure, there are three levels Account > Property > View. The ‘account’ essentially being your business, the ‘property’ referring to the website or app, and then finally ‘view’ which is where your reporting metrics are sourced.

By default you have just one view. We would encourage you to create multiple views depending on how you want to report. If you are going to test filters, then we would encourage you to create a new view, keeping one view that contains all of your raw data so you have a backup. The new view being the one that you use for your primary reporting, which will include your filters.

Why can’t you just add your filters to your default view?

You can of course but if you believe you will ever want that data available for analysis at a later date then you need a backup view.

For example, if you create a filter blocking internal traffic on your one and only view, then all of that internal traffic is lost to you. Create an additional ‘reporting’ view and if for some reason you want to see how your staff have been browsing your site, then you can open up your back-up view and see the data there.


Five Filter Examples You Should Consider

There are many GA filters you can apply, each having more or less significance depending on the nature of the website or business objectives. These example filters are some that we find are useful for most.


Exclude Internal IPs

For reasons we’ve already touched on earlier. This is as simple as it is common. The first step, find out your IP Address. Open up Google and search ‘What’s my IP?’. Google will kindly return your answer. Copy and paste.

Filter internal traffic

Name your filter and select ‘predefined’ as a filter type. Select ‘exclude’ and then ‘traffic from IP address’. Paste your IP address. Click ‘Save’.


Include/Exclude Country

Creating a filter to include or exclude a country may be overkill as you can simply use segments in your reporting to do the same thing. However…

Name your filter and select ‘custom’ as the filter type. Select country or city (under location) from the filter field. Now you can add your nominated country or city for the ‘filter pattern’. It would be best to see how the country is spelled first by visiting your location reporting. Before clicking ‘save’ click to ‘verify’ just to make sure that it will filter correctly.

Google Analytics include or exclude country filter


Excluding Referral Spam

This became an issue a few years back with significant sessions popping up in GA with spammy referring domains and time on site, etc metrics showing 0:00. This completely distorted reporting.

First you should definitely go back into your View>Settings and enable ‘bot filtering’. By doing this, Google will automatically filter known spam referrals.

That should cover a lot of referral spam but more recently we’ve seen more slipping through the cracks. So here’s how you can filter them out.

Name your filter, select ‘custom’ as the filter type and then ‘campaign source’ for the filter field. The ‘filter pattern’ can then be populated with the list of referring domains that you’ve identified as referral spam.

Filtering spam referral sites from Google Analytics

Here’s an example:|||


Www & non-www

Aside from other issues pertaining to having your site load at both the ‘www’ and ‘non-www’ version, GA may be reporting traffic to ‘www’ and ‘non-www’ pages separately.

If you only want to see the ‘non-www’ version:
Name your filter, select ‘custom’ and choose ‘hostname’ in the filter field. Then for the ‘filter pattern’ you can use this format:

Obviously you want to replace ‘yoursite’ with your domain and if you have ‘’ then add the ‘.au’ before the ‘$’.

If you want to see the ‘www’ version
Name your filter, select ‘custom’ and scrolling a little further down select ‘search and replace’. You now want to add this format as the ‘search string’:
Now you simply want to add this in the ‘replace field’:

Again, replace ‘yoursite’ with your own domain and make the change to the .com if you need to.


Lowercase site search

Site search is not something every site has and even less people know or monitor the search usage. It’s a real shame. But if you do, you’ll find that GA can and will separate variations of what we would consider the same search result. For example, lowercase and uppercase. So it’s going to help to get ‘Nike’ and ‘nike’ reported as one.

Name your filter, select ‘custom’ and ‘lowercase’. Then select ‘search term’ and the filter field and save.


Quentin Aisbett

Quentin is the founder of Pocket Insights and search marketing agency Searcht. Searcht (formerly OnQ) was named by business insights firm The Manifest as one of the Top 15 digital agencies in Australia, while named them in their Top 50 Local SEO agencies.

Ready to get started?

Get your first three reports on the house.