Google Analytics: The Beginner’s Guide To Filters
Filters are important, aren’t they? Well, don’t get confused with the image above (Though I love that cocktail), We are going to talk about Google Analytics Filters today.
In case you didn’t notice, we wrote about Goals previously which was so well taken.
— Google Analytics (@googleanalytics) August 31, 2018
Talking about Google Analytics filters, they are something we all have dreaded at some point of time.
But not anymore!
In this guide I am going to walk you through the step by step guide to create Google Analytics filters. While talking about various types of GA filters, we will also have a look on the most useful filters for a website owner.
So all set to start your journey? Let’s not delay it then!
What are Filters?
By default Google Analytics collects the data of all of your visitors. This vast amount of data can often confuse you on which data is actually relevant for your business. Or if I say in better words, what if you want subset of this data for better decision making?
Well, filters are your savior here.
GA filters are a way to ensure that your reporting includes or excludes some specific data based on your requirements.
Let me explain it with an example.
Has it ever happened to you while looking at your GA reports
- You wished some of your data wasn’t there?
- You wanted to exclude your internal traffic to be included in GA reports?
- Perhaps you wanted to get data for a specific subdomain of your website?
Filters are the answer to all of these questions.
With filters, you can create specialized views. These are solely focused on the specific sections of your website traffic. This gives you the privilege to modify or filter the kind of data GA is collecting.
But before we go further, let’s go through some of the terms. Knowing these will help you better understand the concept.
- Google Analytics allows you to create view filters within Admin.
- Creating these filters requires you to have edit-level access.
- The effect on the data is permanent, which means data once lost can’t be retrieved.
- Allow you to create filters on dimension, not only metrics.
- Table filters are the one created in reporting environment.
- Anyone can create these filters, no edit-level access required.
- These filters affect the data temporarily.
- With some advanced table filters, you can apply these filters on any combination of dimension and metrics.
- These are often used to brainstorm your data without any permanent effect.
- Any user can set-up segments.
- Unlike filters, they affect historical data not the upcoming one.
- These are used for short term segmentation like ad-hoc analysis.
Views in Google Analytics:
Filters can be easily applied on one or more views. But before that, let’s understand the best practices of creating views in GA. Ideally, there should be three views in your GA account:
Primary reporting view:
This is the view where you are going to apply the filter. The data provided by this view will be more accurate and personalized.
Raw reporting view:
Since there is no way to reverse a filter and its effect is permanent, you must have a backup for your data. This view will be your backup. The data collected by this view will be free of any filters and collect all of the data.
Test reporting view:
Before applying any filter to your primary view, you must test it. This view will be used to test out your filters and once you are sure that they are working fine, you can apply it to primary view.
Now that you have clear idea about views in GA, I recommend always test your filter before applying it to primary view. There is no UNDO when it comes to GA data.
Setting up filters in Google Analytics:
First thing first, you must have edit access to create view filters in Google Analytics.
Once you have that,
- Click on Admin, and then on Filters.
- To create a filter, click on “+Add Filter”.
A new configuration screen will open up in front of you.
Here you will have to name your filter. Choose the name wisely as it will save you from any confusion in future.
Next you will have to choose among the two types of filters-
We are going to talk about these types in details in the next section.
Once your filter creation is over, you can verify this filter to see if it is working fine and then click on “Save” and you are done. Isn’t it, simple?
PS. As I have already mentioned above, always create your filter first in “Test view” and if it works fine, then only apply it on “Primary view”.
Step 1: Pre-defined Google Analytics Filters:
Predefined GA filters are quite easy to deal with and you can create your own in minutes. There are three options it provides here.
- Filter Type
- Include Only
- Source or destination
- Traffic from the ISP domain
- Traffic from the IP domains
- Traffic to the subdirectories
- Traffic to the hostname
- That are equal to
- That begin with
- That end with
- That contain
As you can see in above table here you have to choose from 32 filters. You can include or exclude any of the following dimensions:
Filter for ISP domain:
If you are a large organization with your own Internet service provider (ISP), you need to use this filter. This ISP domain filter helps you to filter your data on the basis of your domain ISP. You can find your ISP here.
To create this filter you need to mention your ISP domain and click on save and you are done.
PS. If you don’t have your own ISP, don’t use this filter otherwise you will end up filtering other people’s visits too. In that case, you can use IP address filter that we are going to discuss next.
Filter for IP address:
Generally, we don’t want to analyze visits from our own organization. These visits can come from our marketers, developers, etc and can really ruin own data.
For eg, if you have an eCommerce website, and you want to test your checkout process, you don’t want to analyze fake test purchases by your own QA people.
To create this filter, you need to find your IP address. You can find it by Googling “What’s my ip”. For smaller organizations, it is usually just one internal IP address.
Let’s say your IP address is 188.8.131.528, you need to add this address in the section and click on “Save”.
Although, most of the companies use IP ranges. Here’s when regular expressions come into the picture.
Let’s say your IP range is 184.108.40.206 – 220.127.116.11.
Use this tool here.
The filter for this purpose would look like below:
This IP range filter is created using “Custom” filters which we are soon going to discuss.
Filters for sub-directories:
Let’s look at our own website ukhost4u.
Now let’s look move over to the blog section and analyze blog structure.
As we can see, all of the blogs lie in the subdirectory /community/blog/ .
What if we want to provide only the blog analytics access to specific people. What we will do is we will create a view and apply Subdirectory filter here. I will tell you how.
- Choose the option “Include Only”.
- In the second option, click on “Traffic to the subdirectories”.
- In the third option, click on “that begin with”.
- Lastly, provide your “Subdirectory” and click on save.
In the above example, here’s how our filter would look like.
Filter for Host Name:
Let’s say, your website is mydata.com and another website has intentionally/accidentally copied your tracking code for their website. Now you’re getting all mixed up data.
Here you are going to need this filter. All that you have to do is to choose “Hostname” filter and provide your website here, as shown in the image below.
This filter will help you fight spam while also prevent someone else from stealing your tracking code.
Step 2: Custom Filters
Here you will find five main categories of the filters:
- Search and Replace
This comes with endless possibilities. The major categories of these filters are:
- Content and traffic
- Campaign or adgroup
- Mobile device
I will writing on these in upcoming articles here at ukhost4u.
We all know that Google considers an uppercase letter and a lowercase letter as two different characters.
Now let’s say you are using UTM parameters for tracking. But the problem is:
- Matt has tagged his UTM content as video
- Ryan has tagged UTM content as Video
In this case, GA will consider it as two different media when it comes to email campaigns and it can ruin your data in multiple ways.
To make this data more neat, you can use these uppercase/lowercase filters. Usually I prefer to keep everything in lowercase.
So here’s how we will create filter in above case.
It will fix all the issues of capital letters as the UTM content will be video now.
Let’s take another example here. A user uses search function on your website to find “SEO” while the other one uses “seo”. Here you will have to add lowercase filter to “Search terms”.
Some of the areas where you should put lowercase filters are:
- Campaign medium
- Campaign content
- Campaign source
- Campaign name
- Campaign term
- Request URI
Note: Except location based filters, uppercase and lowercase filters can be applied everywhere.
Search and replace filter
Are your Google Analytics report include unreadable identifiers or codes that don’t make any sense at all?
For eg, you have set events for contact form submissions as contact_form_115. But you can easily search and replace it with something more readable say, Contact form in analytics reports.
Here’s how the filter will look like
For these filters, you need to get hold on regular expressions. With advanced filters, you are able to combine multiple fields into variables.
One of the most common use-case of these kind of filters is get host name into reports. Typically, GA doesn’t show host name in reporting. But what if, you want the host name to be displayed in reports which is useful when you have multiple sub domains and you want to analyze the traffic within sub domains.
Here’s the filter we are going to use and then we will see how it works.
Here with field A, we have collected the Hostname and with field B, we have collected the URI and combined them into output.
So now instead of data like this
We will get data like this:
There are multiple possibilities how you can use these advanced filters to create a more specific view for your business.
Step 3: Google Analytics Filter Order:
While you have understood various types of filters, you must understand how they are processed. Here you need to understand about Filter Order.
Filter order is nothing but the sequence in which your filters are going to be applied. Usually filter order doesn’t matter if you are dealing with different aspects of your data. But if you are altering the same kind of data multiple times, filter order is something that matters.
Let’s understand this with a simple example below.
Below I have created an include filter for a specific section on my website.
Filter 1: Include only Marketing blog section of the website
This filter will alter my data so that only following kind of pages will show up in my reports:
Filter 2: Include complete URL
This will alter the output of above filter and now the data will show up like this:
So what’s wrong?
Nothing, I say! But try changing the filter orders for above filters and you will see there is no data.
Wondering why? Let’s analyze here.
The first filter will be now about adding complete URLs, so your data would look like:
Everything is fine until here but when the second filter is be applied, it won’t work. Let me tell you why.
With second filter regex, you intend to match /mblog with a URL that starts with /, but we have already changed it to www.domain.com/mblog in previous filter. So there won’t be any match and thus, won’t be any ata.
So your next question is, how do I change the filter order?
- Click on your “Filters” list.
- Click on “Assign Filter Order”.
With the help of move up and move down buttons, now you can change the filter orders.
Click on Save and you’re done 🙂 To verify this filter, make use of “Real time data”.
Benefits of Google Analytics Filters:
GA filters can help a business in numerous ways. But let’s analyze the major reasons, filters are important for you.
Let’s say, you want to provide access of the blog section to your editor. You want to make sure editor only views the traffic data of the blog section. Here, you can easily create a view filter that collects data only for the blog section and provide access to your editorial team. This way rest of your data is safe and not accessible to all.
Yes, you can always use segments to get specified data. But if you need to look at this data on regular basis, filters can come to your rescue. Also, for someone who is not that expert in Google Analytics, all that you need to do is to create a view with right filter and provide them the access. Simple as that!
Include/exclude specific IP address
If you have an organization with hundreds of employees, internal traffic can really ruin your data. As segments don’t allow you to include or exclude specific IP addresses, view filters is the only way out.
Lastly, filters ensure you get the data that you really need and there are endless possibilities when it comes to filters. So what are you waiting for? Get started now!
Some pointers to keep in mind while using filters
- There is no undo for Google Analytics filters, so choose your filters carefully.
- Before applying filters on primary view, make sure to test it on test view first.
- Always have a backup data view which is completely unfiltered.
- Don’t freak out if your new filters don’t start working, it usually takes around 2 hours for them to work after the set-up.
- If you are working with custom or advanced filter, always keep the filter processing order in mind for right results.
- No matter which niche you belong to, filters are something that would make your data more accurate, helping you take data driven decisions.
Which filters to avoid?
Although filters might excite you, but existence of table filters and segments imply that you don’t always need view filters to get the specific data. In some cases, it is indeed better to use “segments” over “view filters”. Below are some of the situations where you should try to avoid using GA filters:
- Don’t create include/exclude filters for specific geo locations. You can easily get that data with the help of segments.
- Don’t create include/exclude filters for campaign tags.
- Creating filters to find out the devices people are browsing your website from, is not necessary.
What I am trying to say is that, yes filters are extremely important to get customized data. But you must understand that they permanently modify your data. So choose your filters very carefully.