Data (GA/GTM) | Thursday January 14, 2021
A few months ago, Google Analytics 4 (GA4) was made available. Although it does not yet have all the options we were used to, we implement GA4 in addition to the “old” Google Analytics Universal (GA) standard for our customers.
To keep the data as clean as possible, it is important to filter at least a number of internal IP addresses in advance. Examples of IP addresses that you want to filter are the once of the office and of staff working at home. This way you will get a less distorted picture of, for example, how many visitors have been to your website.
In this article, we briefly explain how to filter an IP address in GA4, but also why you should filter both IPv4 and IPv6, but more on that later.
Let’s go through the step by step process of how to filter an IP address from the data in Google Analytics 4.
Go to https://analytics.google.com/
Navigate to the Google Analytics 4 account/domain where you want to apply this filter
On the admin panel at the bottom left of your screen
Go to Data Settings> Data Filters
Click on “Create filter”
Choose “Define internal traffic -Define IP addresses whose traffic should be marked as internal” and click “Create” in the new screen.
Now you will see the following screen:
The name for the filter, make it recognizable so it’s easy to change, filter or remove.
You can use different definitions here, but when you’re filtering internal traffic always use internal.
The standard format is IP address equals, but there are some other options (use them carefully). This one means that only the IP will be filtered that’s in the next field and nothing else.
This equals the IP address you would like to filter in GA4. You don’t know your IP address? You can find it over here https://whatismyipaddress.com/.
It may be the case that there are 2 different IP addresses, both IPv4 and IPv6, choose one of them and enter it. Later, repeat all these steps again and then enter the other IP (I will explain the difference between IPv4 and IPv6 later in the article).
A complete overview of this step:
Everything is set up correctly, so it is time to create the filter. Click on the Create button at the top right. Filtering your IP now works, repeat all steps below if you have multiple IP addresses (do both the IPv4 version and the IPv6 version). We will discuss this further below.
Several internet providers are rolling out IPv6, previously an IP always looked like 241.207.21.100 while nowadays it can also look like this 0:0:0:0:0:ffff:f1cf:1564.
IPv6 is the next-generation IP address standard that is intended to complement and ultimately replaces IPv4, the protocol still used by many Internet services. Any computer, cell phone, home automation component, IoT sensor and any other device connected to the internet needs a numeric IP address to communicate between other devices. The original IP address scheme, called IPv4, is running out of addresses by all devices connected to the Internet today.
IPv4 stands for Internet Protocol version 4. It is the underlying technology that allows us to connect our devices to the Internet. Each time a device connects to the Internet, it is assigned a unique numeric IP address such as 220.127.116.11. The IPv4 numbers are almost gone, hence the switch to IPv6. IP filter not working? In GA Universal it could happen that filtering your own IP did not work, this was often because the GDPR law requires you to anonymize all data. Because your own IP is also anonymized before the data goes to GA, GA cannot filter your IP address. So, in short, it works as follows with the “old” Google Analytics:
Website visitors> Make IP address anonymous> Check if the IP address is filtered? (This step does not work when making IP addresses anonymous)> Display data in Google Analytics
This problem has been solved with GA4, GA4 has automatic IP anonymization built into it, where previously it was done with an extra line of code added to GA. This is no longer necessary with GA4, instead of the IP address being anonymized first and then sent to GA4, GA4 now first checks what the IP address is – if it is excluded, the data will not be included and otherwise the data anonymized. In short:
Website visitor> Google Analytics 4 goes off> Is the IP filtered? > If so, do not display the data in Google Analytics 4> If not, anonymize the IP
Filtering your own data is extremely important and should be set for every customer. If you have not yet set up GA4 for your website, do it quickly so that you have enough data when you really want to get started with Google Analytics.
If you like this blog, you might also like the blog about how to track Scroll Depth using Google Tag Manager and Google Analytics.