Three Google Analytics Filters You Should Be Using Today
In Google Analytics, filters provide a flexible way of modifying the data within each view of your analytics account. You can use them to exclude data, include data, or actually change how the data looks in your reports. Filters help you transform the data so it’s better aligned with your business needs. Google Analytics applies the filters from each view to the raw data collected from your website or app at the time of processing. The filtered data is what we then see in the reporting UI for each view.
There are three filters that every analytics account should set up right away: spambot filtering, excluding internal IP addresses, and forcing all pages/referral sources to lower case.
1. Spambot Filtering
This one is super easy because it’s a simple checkbox on your ‘View Settings’ page. In the admin section, navigate to the ‘View Settings’ page and scroll down until you see the checkbox for Bot Filtering. Check it. There ya go, it’s that easy to filter out a known list of bots and spiders – all you have to do is check the box and Google applies the filter in the background, checking against a known list of bots and spiders.
2. Excluding Internal IPs
First, in Google Analytics, navigate to the Admin section of your Google Analytics view. Then, under the View Settings menu, select ‘Filters’. Select ‘New Filter’. You should see the following filter setup screen:
First, we need to decide if we want to create a new filter or apply an existing filter. You can apply an existing filter if you have filters already set up in another view of the same analytics account by selecting the ‘apply existing filter’ box and selecting the filter you’d like to add to the current view. In this case, however, we’ll select ‘Create new Filter’.
Next, we’ll need to name the filter. Let’s name it ‘Exclude internal IPs’.
Then, we’ll need to choose between a Predefined Filter and a Custom Filter. Predefined filters are templates for some of the most common filters. Custom filters let you truly customize filters to fit almost any unique situation. In this case, since excluding IP addresses is a common filter, we can select the Predefined filter for excluding traffic from the IP addresses that contain our businesses IPs. We’ll enter the IP for our business in the box that appears, like this:
The final step is to verify the filter, but in this case, Analytics cannot provide a preview for this filter because previews for advanced filters and location-based filters (e.g, IP address, Country) are not supported at this time.
Finally, hit save. Once we’ve saved this filter and applied it to a view, Google Analytics starts checking the IP addresses of traffic to the web property. Any traffic data from the IPs that you’ve excluded in the filter will be thrown out of the views to which the filter has been applied.
3. Forcing URLs to Lowercase
We can also use a filter to clean up our data. For example, sometimes a website will show the same page regardless of the case of the URL — uppercase, lowercase or mixed case. You may have pages with URLs such as ThankYou.html, thankyou.html, and THANKYOU.html, and without a filter to force them all to the same case, they would show up as three separate pages in a pages report in Google Analytics.
To prevent this separation and see the page data in aggregate, we can set up a lowercase filter to force all of the URLs to a single case. This is an important filter to set up to ensure we are analyzing the total impact of a page on our website rather than taking a chance on aggregating several different versions of the same URL.
Select ‘New Filter’. We’ll leave ‘Create new filter’ selected and title this filter ‘Force URL to Lowercase’.
Next, select ‘Custom’ as the filter type. Then select the box for ‘Lowercase’. Because we want to ensure that the whole URL is forced to lowercase, we’ll select the ‘Field type’ ‘Hostname’. Note the info bubble which explains why you would want to use a filter like this one.
Finally, hit ‘Verify filter’ to ensure you’ve got the filter setup correctly and then hit ‘Save’.
NOTE: Filters, like all configuration settings, are not applied retroactively to your data. They are only applied from the moment you create them.
Now that you’ve setup three of the most common and useful filters, you’re on your way to having a cleaner data set in your reports.