How filters help you read between the lines in Google Analytics

This article was migrated from an older iteration of our website, and it could deviate in design and functionality.

Do you want to separate internal traffic from external? Or have a separate view to just see traffic to a subpage at your site? Maybe you want a way to exclude spam referral traffic? It is all possible, with filters.

Estimated read time : 8 minutes

Jump to

Filters help you see your data in a different light

You might wonder why we should filter out some of the traffic? The more visitors the more business, right? Not really, unfortunately. When looking at just a number it is easy to forget that part of that number is you yourself, your colleagues, maybe some spam traffic hiding in there as well. If taking all of that away, the actual number symbolising your real visitors might be considerably smaller but it is better going forward from today with some real statistics.

 If you are familiar with the recommendation for how to set-up views in Google Analytics, you will already know that filters are used to segment out visitors in different ways. The most important thing to remember is to test your filters in a Test view before applying it to the view you read daily, as to make sure you get the expected result. If you have not yet created any other views than the one that came with the account, then read our post on 3 views you need in Google Analytics.

Filters do not change your data historically. That means that they will only filter data from that date and forward. Rather than trying to change filters, it is recommended to instead use segmentations.

Exclude internal traffic

Excluding the IP address for where your office is based is an absolute recommendation. Otherwise all those visits you do to your own site on a daily basis will be blended in with your actual visitors. You could, also, setup a separate view and choose only to include visits from a certain IP address, if you want to track the traffic coming from your own company.

To find out what your IP address go to:

Another reason to create a filter is to exclusively see traffic for a specific subdirectory, or subdomain. Again, this is when you might want to setup a separate view for each subdomain so that you can view your reports for each one.

You might have seen a type of referral link in your data that are part of spam traffic. Dealing with spam can be tricky but with the help of filters some of these issues can be resolved.  Learn more about spam traffic in our post Identifying spam & ghost referrals in google analytics.

How to setup filters

Filters can be created on both account and view level. Either in admin mode, in the column for View, click on Filters and then Add filter, or in admin mode, in the column for Account, click on Filters and then Add filter. The difference is that you either start with creating a filter and then choose for which views it should be applied. Or you start by choosing the view straight away and what filters that are to be applied to it.

You can choose between adding a new filter, or applying a filter you have already created to another view, for example if you have tested a filter in your Testview and then decide to add it to All Website Data + Filters. Decide on a name for you filter, it should be clear what the purpose is and easy for anyone working with the account to understand. In filter type, choose either predefined or custom.

Here is an example of how to set up a custom filter that excludes certain referral links, as they have been detected as spam traffic. You can create additional filters to continue to exclude these links, if you run out of space in the filter pattern.

The order of your filters matter

Having more than one filter for a view is common, but do not forget that collection of your data will start from the top and filter its way down through your traffic. The above filters will affect the ones underneath so be sure you are clear with what you want to start filtering out. You can change the order of filters in admin mode in the View column by clicking on Filters > Assign Filter Order.


Remember that filtering data will remove data that you cannot retrieve once you have chosen to remove it. This is why it is so important that you always keep one of your views unfiltered! Filters do not change your data historically, so add an annotation for when any filters were added. Learn more about annotations in our blog post Annotations in Google Analytics help you See correlations of data with real-world events. Also worth noting is that it can take up to 24 hours before the filters are applied to your data.