Before we apply filters it is strongly recommended to have the following three Google Analytics views for your GA property:
Unfiltered view (raw data): You should always have an unfiltered analytics view which contains all of your data without any filter. This view can be used as a backup if any data issues happen in other views. No filters should be applied to this analytics view.
Main view (reporting view): This view should be used for reporting purposes. This view will have all your filters applied to the data once they are verified and tested in test view.
Test view: Test view can be used for testing purposes. This view will be a replica of the main view but you will use this view only for testing filters for a few days. Remember after applying filters you will only see the data that you allowed to pass in through filter configuration. The filtered data will never be reported and it’s gone forever. It is better to have a test view where you can verify the filter configuration is working properly and then you can replicate those in the main view.
Top Google Analytics filter #1: Exclude internal and third-party agency traffic
Generally your internal employees and the third-party agency visits on your website on a regular basis to check site functionality or campaign validation.
This will generate data from internal users and external users and it will be difficult to check how actual customers are interacting with your website.
You can use this filter to exclude the traffic from internal employees and all the third-party agencies you work with.
Follow the below steps to create this filter:
Step-1: Navigate to your Google Analytics account and click on the ‘Admin’ option.
Step-2: Select the property from the ‘Property’ column.
Step-3: Select the required view from the ‘Views’ column and click on ‘Filters’.
Step-4: You will get an overlay like below. Click on ‘Add Filter’:
Step-5: Give your filter a valid and easy to understand name.
Step-6: Now you need to select the filter type. There are two types of filter; one is ‘predefined’ and other is ‘custom’.
Predefined filters are used only for traffic-related data like include or exclude traffic.
Custom filters can be used with the majority of Google Analytics dimensions.
Top Google Analytics Filter #3: Include internal and third-party agency IP
It is recommended to create a separate Google Analytics view only for internal traffic. Then you can use this filter to include traffic from internal employees and all the third-party agencies you work with.
Filter Configuration
Filter Name: Include Internal and third-party Agency IP
Filter Type: Custom
Filter Option: Include
Filter Field: IP Address
Filter Pattern: ^192\.100\.0\.1$|^192\.168\.0.$
Note: Change your IP address in ‘Filter pattern’ according to your list.
Top Google Analytics filter #4: Include specific domain or hostname
This filter is very useful if you are tracking more than one website or domain. Another use of this filter will be to exclude referral bot traffic from multiple domains to your website.
Let’s take an example, suppose you have placed your tracking code on ‘optimizesmart.com’ and ‘blog.optimizesmart.com’, and you have created separate analytics views for each.
In this case, you would like to see data separately on the blog view and only for blog pages. Hence you can create a filter to include the hostname, like below:
Filter Configuration
Filter Name: Include blog.optimizesmart.com Only
Filter Type: Custom
Filter Option: Include
Filter Field: Hostname
Filter Pattern: ^blog\.optimizesmart\.com$
Top Google Analytics filter #5: Add hostname to pages
This filter is very useful if you have implemented cross-domain tracking on the website. This filter will add the hostname at the beginning of the pages.
For example, suppose you are tracking ‘abc.com’ and ‘xyz.com’ and both have similar url architectures. The home page of both websites will show as index.html in your cross-domain reporting view so you will get confused about what was the hostname that bought the traffic to the website.
Hence you can apply the add hostname to pages filterand instead of seeing ‘index.html’ in the reporting view, you will see ‘abc.com/index.html’
Filter Configuration
Filter Name: Add Hostname to Pages
Filter Type: Custom
Filter Option: Advance
Filter Field A: Hostname
Filter Field A String: (.*)
Filter Field B: Request URI
Filter Field A String: (.*)
Output to Construct Field: Request URI
Output to Construct Field Text: $A1$B1
Field A Required Checkbox: Tickmarked
Override Output Field: Tickmarked
Top Google Analytics filter #6: Lowercase page URL (request URI)
This filter is very useful if you have any uppercase words in the URL of the website. This filter will convert all the uppercase word to lowercase.
Filter Configuration
Filter Name: Lowercase Page URL
Filter Type: Custom
Filter Option: Lowercase
Filter Option: Request URI
Top Google Analytics filter #7: Lowercase site search term
Users on the website can search using any casing. Some users may search for ‘PRODUCTS’, some many search for ‘products’ and a few may even search ‘Products’.
This filter is very useful if you have any uppercase letters in the site search term. This filter will convert all the uppercase letters to lowercase.
Filter Configuration
Filter Name: Lowercase Site Search Term
Filter Type: Custom
Filter Option: Lowercase
Filter Field: Search Term
Top Google Analytics filter #8: Lowercase campaign names
It might be possible that in your organisation different campaigns are run by different teams that are likely to have different naming conventions and casing.
Applying this filter is recommended to convert all campaign names to lowercase, in order to have clean data in your reports. You can also create such filters for other campaign dimensions as well.
Filter Configuration
Filter Name: Lowercase Campaign Names
Filter Type: Custom
Filter Option: Lowercase
Filter Field: Campaign Names
Top Google Analytics filter #9: Search and replace
You can use the search and replace filter to clean or modify data in your reporting. Let’s suppose your website can be accessed using both ‘www.abc.com’ and ‘abc.com’.
In Google Analytics reporting, you will see two rows; a separate row for each hostname. In such a case you can apply a search and replace filter to get just one row.
Filter Configuration
Filter Name: Search and Replace Hostname
Filter Type: Custom
Filter Option: Search and Replace
Filter Field: Hostname
Search String: ^abc\.com$
Replace String: www.abc.com
Top Google Analytics filter #10: Include Device Category
If you have created separate views in Google Analytics for mobile, desktop and tablet, you can use the below filter to include traffic from a specific device only.
As an example, I am creating a filter that contains traffic only from mobile devices.
Filter Configuration
Filter Name: Include Mobile Traffic Only
Filter Type: Custom
Filter Option: Include
Filter Field 1: Device Category
Filter Field 2: Mobile
Top Google Analytics filter #11: Include traffic medium
If you wanted to check the performance of a particular traffic medium in a separate Google Analytics view, you can consider applying the below filter.
For example, I have created a view in Google Analytics which contains a filter that allows traffic from social media only. The filter configuration is like below:
Once I click on ‘Verify filter’, it gives me a ‘Filter verification’ preview table, like the one below:
The first section contains data before the filter was applied. As you can see, it includes sessions from ‘cpc’, ‘organic’, and ‘referral’. We have applied filters in such a way that it should contain traffic from social media only.
After the filter is applied, sessions from ‘cpc’, ‘organic’, and ‘referral’ should not be included in the view. We can see the result in the second section.
Frequently asked questions about top Google Analytics filters for every website
What is a filter in Google Analytics?
Filters in Google Analytics allows you to control and modify the data which is included in a Google Analytics reporting view. For example, you can apply filters to stop internal traffic being reported on your website, in order to have more accurate data.
What are the types of filters available in Google Analytics?
There are two types of filter; one is ‘predefined’ and the other is ‘custom’.
Predefined filters are used only for traffic related data, like include or exclude traffic from particular sources or destinations.
Custom filters can be used with the majority of Google Analytics dimensions.
Can I apply filters on historic data?
Filters are permanent data control and modification rules and so they work from the day they were created. You cannot apply filters on historically processed data.
What are the most recommended filters for a website?
The top filters you should consider applying on your website are:
Exclude internal and third-party agency traffic Exclude dev and staging traffic Include internal and third-party agency IP Include specific domain or hostname Add hostname to pages Lowercase page URL (request URI) Lowercase site search term Lowercase campaign names Search and replace Include device category Include traffic source/medium
Register for the FREE TRAINING...
"How to use Digital Analytics to generate floods of new Sales and Customers without spending years figuring everything out on your own."
Here’s what we’re going to cover in this training…
#1 Why digital analytics is the key to online business success.
#2 The number 1 reason why most marketers are not able to scale their advertising and maximize sales.
#3 Why Google and Facebook ads don’t work for most businesses & how to make them work.
#4 Why you won’t get any competitive advantage in the marketplace just by knowing Google Analytics.
#5 The number 1 reason why conversion optimization is not working for your business.
#6 How to advertise on any marketing platform for FREE with an unlimited budget.
#7 How to learn and master digital analytics and conversion optimization in record time.
My best selling books on Digital Analytics and Conversion Optimization
Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.
Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.
Attribution Modelling in Google Analytics and BeyondSECOND EDITION OUT NOW!
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.
Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.
About the Author
Himanshu Sharma
Founder, OptimizeSmart.com
Over 15 years of experience in digital analytics and marketing
Author of four best-selling books on digital analytics and conversion optimization
Nominated for Digital Analytics Association Awards for Excellence
Runs one of the most popular blogs in the world on digital analytics
Consultant to countless small and big businesses over the decade
Learn and Master Google Analytics 4 (GA4) - 126 pages ebook
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
Cookie
Duration
Description
cookielawinfo-checkbox-analytics
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional
11 months
The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy
11 months
The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.