{"id":4191,"date":"2020-05-14T11:11:48","date_gmt":"2020-05-14T11:11:48","guid":{"rendered":"https:\/\/trackingchef.com\/?p=4191"},"modified":"2024-10-28T19:01:44","modified_gmt":"2024-10-28T16:01:44","slug":"creating-filters-in-google-analytics","status":"publish","type":"post","link":"https:\/\/trackingchef.com\/google-analytics\/creating-filters-in-google-analytics\/","title":{"rendered":"Creating filters in Google Analytics"},"content":{"rendered":"\n
A Google Analytics (GA) Property can be split into multiple Views, to simplify your analysis and limit the data visible to different stakeholders in the organization.<\/p>\n\n\n\n
Using filters, the GA account admin can limit each View to a specific subset of data collected by the Property.<\/p>\n\n\n\n
In this post I will explain how to create filters with examples of common filters I use.<\/p>\n\n\n\n
Important notes on filter<\/h2>\n\n\n\n
\n
Filters can only be created by users with Edit permissions to the Google Analytics account. Other users can only add or remove an existing filter to a View.<\/li>\n\n\n\n
Filters are managed on the Account level and can be shared across Properties and Views.<\/li>\n\n\n\n
Filters do not apply retroactively so that they will only effect data from the point they were set and onwards. If you have damaged data in your View, it will not fix that (you can probably use a Segment to fix most of it).<\/li>\n\n\n\n
Multiple filters can be applied to a single view, but they will act in the order in which they are set.\n
\n
A good example is filtering out internal traffic and then only traffic to the blog, which will return a “clean” view of non-employee blog traffic.<\/li>\n\n\n\n
A bad example is filtering in only traffic from the UK and then only traffic from Argentina. This will result in no data, as no user can answer both criteria simultaneously.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n
Creating a Filter<\/h2>\n\n\n\n\n
To create a filter, navigate to your account’s Admin page.<\/li>\n\n\n\n
Select the relevant Account, Property and View<\/li>\n\n\n\n
Under the View column, click on “Filters”<\/li>\n\n\n\n
You will see a list of the existing set for this View and their order (you can set the filter’s order by clicking “Assign Filter Order”)<\/li>\n\n\n\n
Click “+Add Filter”<\/li>\n\n\n\n
You can then choose to create a new filter or apply an existing one from your account<\/li>\n\n\n\n
When creating a new filter you also need to set its name. I recommend using descriptive names, e.g. “Exclude internal traffic” or “Include only blog traffic”<\/li>\n<\/ol>\n\n\n\n
Creating a Predefined Filter<\/h3>\n\n\n\n
Google Analytics offers four standard filters as predefined, making them simple to create. <\/p>\n\n\n\n
\n
Select the Filter Type “Predefined”<\/li>\n\n\n\n
Select the filter type, Exclude or Include.\n\n
Exclude will filter OUT <\/strong>sessions that match the criteria<\/li>\n\n\n\n
Include will filter IN <\/strong>only sessions that match the criteria<\/li>\n<\/ol>\n<\/li>\n\n\n\n
Select the filter criteria – What do you want to filter by?\n\n
ISP Domain – This filter is obsolete as this data point has been deprecated in 2020<\/li>\n\n\n\n
IP Addresses – This filter can be applied to filter out internal traffic (or filter in only Dev traffic) Your IP address can be easily found by Googling “What is my IP address”. This filter can also be applied to an IP C-Class to exclude multiple IPs.<\/li>\n\n\n\n
Subdirectories – This filter can be applied to include only traffic to a specific subfolder on you site, e.g. a blog that sits under \/blog<\/li>\n\n\n\n
Hostname – This filter can be applied to include\/exclude only traffic to a specific domain or subdomain, e.g. a blog that sits on blog.example.com<\/li>\n<\/ol>\n<\/li>\n\n\n\n
Select the criteria expression – How do you want to match the criteria?\n\n
That are equal to<\/li>\n\n\n\n
That begin with<\/li>\n\n\n\n
That end with<\/li>\n\n\n\n
That contain<\/li>\n<\/ol>\n<\/li>\n\n\n\n
You can then add the criteria to match in the field shown<\/li>\n<\/ol>\n\n\n\nPredefined filter in Google Analytics<\/figcaption><\/figure>\n\n\n\n
After the filter is set up, you can test the filter before saving by clicking “Verify this filter”. This will test the filter against traffic from the past 7 days to see how the data would have been impacted. If this is a new account without previous data, this test is irrelevant.<\/p>\n\n\n\n
In the case of IP related filters, this test isn’t supported as Google Analytics doesn’t store IP data for future reporting (it is only used in the initial data processing of a session).<\/p>\n\n\n\n
Creating a Custom Filter<\/h3>\n\n\n\n
For more complex uses, Google Analytics offers the option for Custom Filter. Aside from include\/exclude filters, these filters can also be used to manipulate the data collected by GA.<\/p>\n\n\n\n