How do I use Google Analytics filters

What are filters in Google Analytics?

Filters allow you to modify what data gets tracked by Google Analytics, and how it gets tracked. By creating a filter, you can make Google Analytics process data in a way that’s clearer to analyze, for example by combining or excluding certain data, like certain URLs. 

This allows you to make your data more accurate, easier to process, or more unified. For example, you can exclude various subdomains from being tracked. We, for example, could use a filter to exclude traffic from blog.convertmind.com so we could focus on data from convertmind.com. We could even create a second view with an opposite filter where we could look at just blog.convertmind.com. Another common use is filtering out IP addresses, which would allow you to exclude yourself and your team from the results and thus make the results more accurate.

What types of filters are there?

There are four predefined filters you can use to to easily create commonly used filters. In addition to this, you are able to create your own custom filters to filter whatever you desire. 

The four predefined filters are:

  • Traffic from the ISP domain: exclude or only include traffic that comes from a certain domain. You can use this to exclude traffic coming from your company network, for example.
    Note: if you specify a domain name, don’t include the host server label. For example, we’d specify ‘convertmind.com’, not ‘www.convertmind.com’.
  • Traffic from the IP addresses: exclude or only include traffic that comes from a specific given IP address, or any IP addresses that match a part of an IP address you specify. If there are specific devices or users you want to exclude from the results, this can be useful.
  • Traffic to the subdirectories: exclude or only include traffic that comes from a particular subdirectory. For example, setting it to exclude ‘/help’ will filter all data related to the Help page out of the results.
  • Traffic to the hostname: exclude or only include traffic to a particular hostname. For example, we could use this to exclude people from blog.convertmind.com so we’d only see data from convertmind.com.

All four of these filters can be set to either ‘exclude’ or ‘include only’. ‘Exclude’ will of course create a filter what will exclude your input from the gathered data. ‘Include only’ will make it so that data that includes what you set as a filter is the only data that’ll be recorded and shown.

In addition to these predefined filters, you can create your own custom filters. You can use these to exclude or only include data based on basically any parameter you want, from screen resolutions to browsers to campaign names to Google Ads campaigns to even the version of Adobe Flash being used if you really want to. 

There are five main types of custom filters:

  • Exclude: Excludes all data with the defined parameters from being recorded
  • Include: Only captures data with the defined parameters, and doesn’t capture all other data
  • Lowercase: Turns all data captured within the set field into lowercase
  • Uppercase: Turns all data captured within the set field into all uppercase
  • Search and Replace: Looks for data that matches the set parameters, and replaces it with a different set string in the final results
  • Advanced: This is a special type of filter that allows you to create a custom field by taking data from one or two existing parameters, and putting it into a separate category. 

What can I use filters for?

Filters are used to change the captured data to include, exclude or otherwise change it. You can use this for a wide variety of purposes. Here, we’ll just run through some of the most common ones. 

Many sites include subdomains. For example, blog.convertmind.com is a subdomain of convertmind.com. It’s not unthinkable you may want to track a subdomain separately from the rest of the site, or vice versa. You can use filters to make this possible. 

You can do this for specific pages on your site too. Only want to track convertmind.com/beta? Or want to exclude that from the results? With the predefined subdirectory filter, you can do that.

If you run the site, naturally you’ll be on it often. You may want to keep this out of your Analytics data to make it more accurate. After all, you’re not on there as a customer. You can do this using filters, by filtering out your IP address from the results using the predefined filter.

If you have multiple people working on a campaign, they may use different capitalization within their work. This could cause ‘Great Campaign’, ‘Great campaign’ and ‘great campaign’ to appear separately in your results. Using a filter, you can simply force these all down to lowercase to make sure they’re all captured together. 

What are the limitations of filters?

Filters are incredibly useful tools when used right. However, they shouldn’t be taken lightly. When used carelessly, they can be hugely destructive and bring you a lot of trouble. On top of this, there are simply some restrictions that you need to keep in mind when you use filters. Here, we’ll run through the most prominent ones.

First of all, filters are destructive. A filter doesn’t just change how data is shown: it changes the data itself. If you use a filter to exclude certain data, that data won’t just be hidden, it will be completely erased. There is no way to recover this potentially lost data! Because of this, it’s highly recommended to always keep an extra view without any filters set, so you will always have a backup with all data included.

When creating filters, also keep in mind that they don’t just exist on a view level. They exist on the account level. You can view all filters under an account by going to ‘All Filters’ under your Account settings. Here, you can also select what views the filters should be applied to. Make sure you always check this after editing filters to make sure they’re doing what you want them to do.

When applying a filter, also keep in mind it takes up to 24 hours before it goes into effect. The advantage of this is that you have some time to catch potential mistakes before they take effect. But the downside is that you won’t immediately see results. Bottom line: after applying a filter, wait a day to check on what it’s doing.

How do I set up a filter in Google Analytics?

You should now have an idea of what type of filter you want to use. If you don’t, just go through the explanation above again, compare the different filter types and determine which one works best for the goal you want to accomplish. 

If you know what type of filter you want to use, follow the steps below:

  • On the Google Analytics homescreen, go to your Admin settings (the gear icon in the left menu)
  • In the Account column (the one on the left), go to ‘All filters’
  • Click ‘+ Add Filter’
    Are you not seeing this button? Then you don’t have permission to create filters. You need edit permissions on the account level in order to create filters
  • Enter a name for the filter. Make sure to go with something that allows you to easily identify and distinguish it.
  • Choose either ‘Predefined’ or ‘Custom’, depending on the type of filter you want to create.
  • Choose the type of predefined or custom filter you want to create
  • Fill in the fields shown
  • Under ‘Available views’, you should see a list of views you can apply the filter to. Choose the views you want to apply it to, and click ‘Add’.
  • Click ‘Save’ to save and apply your filter.

Congratulations! Your filter is now applied and ready to go!

Note: when deciding on a string, keep in mind that Google Analytics won’t always take your string literally. There are certain characters which Google Analytics could interpret differently, which are known as regex. These could really mess up your data if you’re not aware of them, but can be incredibly powerful if you know how to use them. So make sure you read up on them.

Do Google Analytics filters apply retroactively?

Filters applied within Google Analytics do not apply retroactively. In other words, if you apply a filter in Google Analytics, all data gathered prior to the implementation of said filter will not change to match the filter. Similarly, removing the filter will not change data gathered while the filter was active. 

This means that if you enable or disable a filter, this could cause differences to occur between data gathered before and after doing this. Keep this in mind when analyzing the data afterward.

In what order does Google Analytics filter data?

You can apply multiple filters to a single view. When it comes to how these filters are handled, Google Analytics is rather simple. It simply processes the filters in the order you apply them. 

There may be some cases you want a specific filter to be applied first. For example, when a certain filter is applied second it may miss some data already pushed out by the first filter (this can also happen accidentally, so be wary of this). In these cases, you may want to change the order of filters. You can do that like this:

  • On the Google Analytics homescreen, go to the Admin settings (the gear icon in the left menu)
  • Go to the View column (right), and select the view you want to adjust the order for
  • Go to ‘Filters’
  • Click ‘Assign Filter Order’
  • Select the filter that you want to move in the rank, and click ‘Move up’ or ‘Move down’ to move it.
  • Click ‘Save’

And voila! Your filter order has been changed!

What is a filter pattern in Google Analytics?

In Google Analytics, a filter pattern is essentially the thing you are filtering for. Everything that you set up after the filter type is essentially the filter pattern. For example, take a look at the image below. Everything included within the blue border is the filter pattern.

How do I filter out internal traffic in Google Analytics?

If you manage a website, it’s very likely you will frequently visit it. If you work for a large company, other people from said company may often visit the site too. This data is usually not very interesting in Google Analytics. After all, none of these people will actually convert on your site. Because of this, you may want to filter them out from your Google Analytics results. Thankfully, this is possible. However, the way you do this depends on what you want to filter.

Before you start, it’s important that you determine what you want to filter. Do you want to filter a single IP adres, a whole subnet of IP addresses or an IPv6 address? Determine this and choose the correct plan based on this. If you are unsure which technique you need, or you are unfamiliar with working with IP addresses in the first place, it’s recommended you consult an expert for help.

Filter out a single IP address

To filter out a single IP address, follow these steps:

  1. On the Google Analytics homescreen, go to your Admin settings (the gear icon in the left menu)
  2. In the Account column (the one on the left), go to ‘All filters’
  3. Click ‘+ Add Filter’
    Are you not seeing this button? Then you don’t have permission to create filters. You need edit permissions on the account level in order to create filters
  4. Enter a name for the filter. Make sure to go with something that allows you to easily identify and distinguish it.
  5. Set the filter type as Predefined
  6. Set the left dropdown menu with the options Exclude and Include only to Exclude
  7. Set the middle dropdown menu, labeled Select source or destination to traffic from the IP addresses
  8. Set the right dropdown menu to that are equal to
  9. In the field labeled IP address, fill in the IP address you want to filter
    Note: because this field is intended for IP addresses, you don’t have to use regex for the dots here
  10. Save your changes

And done! Your filter is now set.

Filter out a subnet of IP addresses

You may want to filter out a subnet of multiple IP addresses, such as 192.168.0.*. If you want to do this, follow these steps:

  1. On the Google Analytics homescreen, go to your Admin settings (the gear icon in the left menu)
  2. In the Account column (the one on the left), go to ‘All filters’
  3. Click ‘+ Add Filter’
    Are you not seeing this button? Then you don’t have permission to create filters. You need edit permissions on the account level in order to create filters
  4. Enter a name for the filter. Make sure to go with something that allows you to easily identify and distinguish it.
  5. Set the filter type as Predefined
  6. Set the left dropdown menu with the options Exclude and Include only to Exclude
  7. Set the middle dropdown menu, labeled Select source or destination to traffic from the IP addresses
  8. Set the right dropdown menu to that begin with
  9. In the field labeled IP address, fill in the subnet you want to filter. For example, if you want to filter out all IP addresses that match 192.168.0.*, you’d fill in 192.168.0 here.
    Note: because this field is intended for IP addresses, you don’t have to use regex for the dots here
  10. Save your changes

And done! Your filter is now set.

Filter out IPv6 addresses

Filtering out IPv6 addresses works the same way as filtering out regular IPv4 addresses. If you want to filter out an IPv6 address, follow these steps:

  1. On the Google Analytics homescreen, go to your Admin settings (the gear icon in the left menu)
  2. In the Account column (the one on the left), go to ‘All filters’
  3. Click ‘+ Add Filter’
    Are you not seeing this button? Then you don’t have permission to create filters. You need edit permissions on the account level in order to create filters
  4. Enter a name for the filter. Make sure to go with something that allows you to easily identify and distinguish it.
  5. Set the filter type as Predefined
  6. Set the left dropdown menu with the options Exclude and Include only to Exclude
  7. Set the middle dropdown menu, labeled Select source or destination to traffic from the IP addresses
  8. Set the right dropdown menu to that begin with
  9. In the field labeled IP address, fill in the IPv6 address you want to filter, without the subnet. For example, if you want to filter out 2620:0:10e2:2:c4bc:9fd2:974f:cf19, you’d fill in 2620:0:10e2:2:c4bc:9fd2:974f
  10. Save your changes

And done! Your filter is now set!

Tip: using regex, you can create more complex filters where you could filter on multiple things at once. 

Can Google Analytics track IP addresses?

Technically it can. In order for Google Analytics to function, it needs to collect the IP addresses of users in order to collect their data. However, by default Google Analytics will anonymize this data and make it unavailable for you to view. This makes sense, as IP addresses are personal information that, when easily accessible, could raise a lot of privacy concerns. 

There are some ways to bypass this anonymization and gain insight into the IP addresses that trigger Google Analytics. However, these require the use of extra code from external sources. Doing this also raises a lot of privacy concerns, so make sure you consult a legal expert before you try to do such things.

Does Google Analytics track my own visits?

By default, Google Analytics does track your own visits. If you visit your site, Google Analytics will treat you the same as any other visitor, and thus add your data to its collection.
There are ways to prevent this, however. Using filtering, it’s possible to exclude yourself from your Google Analytics results. Specifically, you can do this using IP filtering.

Turn Google Analytics into conversions

Let smart algorithms audit your Google Analytics data. Find hidden conversion leaks and increase your conversions.

Create account