When evaluating the performance of your digital marketing efforts, using a defined set of IP filters in Google Analytics 4 will prevent you and your staff from skewing the data and keep your reporting accurate.
When recording data from your website in Google Analytics, it should always be as accurate as possible. One detail that is often overlooked during setup is IP filters. These are fairly straightforward to set up in Universal Analytics, but setting up an IP filter in GA4 is a bit more involved.
What is an IP Filter in Google Analytics?
Whenever a visitor arrives at your website they will visit from a specific IP address on the internet. To protect visitor privacy and to adhere to data protection laws, this data is automatically anonymised before being processed or stored, however all traffic will still arrive from a specific IP address.
IP Anonymisation is automatically enabled in Google Analytics 4 as part of Google’s effort to protect user data.
IP filters can be applied to your GA4 property to automatically remove a specific set of traffic from your reports, removing all GA4 events from being recorded from specific (or collection of) IP addresses.
When should I use an IP filter in Google Analytics 4?
There are a couple of scenarios where you may wish to use an IP filter in GA4. In the majority of circumstances, recording every bit of data is important for the accuracy of your reporting. However there are situations where recording particular data can result in non-realistic results.
The main scenario is to prevent the interactions of your own employees being recorded on the site. They may use the site for a number of reasons:
Testing new site features and changes
Performing regular maintenance on the website
Implementing data tracking behind the scenes
Updating page content on the website
This is not an exhaustive list, but there are a variety of reasons employees and staff may be using the website. The important point to consider is that when using your website they are not realistic site visitors. The actions of your employees may be reflected in reports as showing pages performing very well or very poorly, when in fact that data is not accurate as far as a genuine visitor is concerned.
Free Digital Tips Direct to your Inbox!
Be among the first to receive tips, advice and news on all things digital performance related. From new features in Google Analytics, Data Studio and other tools, to interesting articles, videos and more! Completely Free! (Unsubscribe any time you like!)
How do I create an IP filter in Google Analytics 4?
Universal Analytics has a section dedicated to filters, which include IP filters at the View level of properties. As Views do not exist in Google Analytics 4 the process has changed significantly.
An IP Filter set up in Universal Analytics.
In Google Analytics 4 IP filters can be set up by accessing the Data Stream. This is the part of GA4 that sends all data from your website to Google Analytics 4 to populate your reports with information.
To begin setting up your IP filter, first navigate to Admin -> Property -> Data Stream. Select the stream for your website and scroll down to the Google Tag options and select “Configure Tag Settings”, followed by “Define Internal Traffic”.
Previously known as “More Tagging Options”.
As we’re wanting to exclude traffic from employees and staff of the business itself, we can define any such traffic as “internal” and exclude it from reports. Within these settings there is an option to “Define Internal Traffic”, which will let us select an IP address (or range of addresses).
Defining internal traffic allows you to exclude it from reports.
Once it’s defined all events will be tagged with the “traffic_type” event parameter with the value of “internal”. Bear in mind that every part of GA4 is considered an event. We have a blog post on GA4 events if you want to learn more about those!
Within the internal traffic options, we can decide what to assign as internal traffic by matching it to an IP address, or set of IP addresses if your business has its own network.
A defined IP Filter set up in Google Analytics 4.
However defining internal traffic is not enough on its own to exclude the traffic from reports automatically. As all actions within Google Analytics 4 are treated as events with parameters, we need to tell GA4 what to do when it detects any events marked with the traffic type “internal”.
We can filter all kinds of traffic from reports using Data Filters. These are found at Admin -> Property -> Data Settings -> Data Filters.
Data Filters can exclude all kinds of data from your GA4 property, once defined.
Internal is added by default, in what is known as testing mode. This means it wont be quite live yet, but is ready to be tested to make sure it works.
Testing Your IP Filter
GA recommends filters be tested first beforehand. Once active, any filtered data will be missing from your reports, and if the filter is set up incorrectly, you may lose data forever.
To test the IP filter, we would recommend using the real-time report and looking at what events are detected, by comparing all traffic with filtered traffic. To begin, open up the Google Analytics 4 real-time report, and add a new comparison to the report.
Comparison data can be added to reports.
Google Analytics 4 does help when selecting what data to compare by providing a dimension called “Test data filter name”. As we have assigned our IP addresses to the Internal Traffic data filter, we can select this one as the dimension.
GA4 comes with a dimension to test Data Filters.
By adding a comparison with Internal Traffic, you will be able to see if the filter is working correctly by comparing it with real time traffic. All traffic will appear under “All Users” and only traffic you want to exclude should show up as “Internal Traffic”. By using a device connected via the IP address you want filtered, you should be able to see yourself as a user appear as Internal Traffic.
By using a comparison, you can make sure your own visits are picked up by the filter before activation.
After testing, if the IP filter works as intended, then the filter can be updated to “Active” instead of “Testing” using the 3-dots or options via the arrow to enable the IP filter in Google Analytics 4 reports.
Once ready, you can activate the Data Filter to switch on your IP Filter.
Once enabled, your GA4 property will automatically exclude any traffic from IP addresses listed in the filter. You will be able to browse, update and edit your own website without influencing the data that is used for reporting for a more accurate representation of your genuine website visitors.
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
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.
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.
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.