Excluding internal traffic with IPv6 addresses
3 min read

Digital Analytics: GA4 - Excluding internal traffic with IPv6 addresses via CIDR notation… or better not?
Digitalization is advancing relentlessly, and with it, the continued development of network technologies. IPv6 addresses are becoming increasingly important as the IPv4 address space is slowly being exhausted. But how does this fit into the world of Google Analytics 4, which was primarily designed for IPv4? The use of IPv6 in GA4 presents both opportunities and challenges. In this blog post, we’ll explore how to use IPv6 addresses in GA4 to filter internal traffic and address the hurdles that arise from GA4’s focus on IPv4.
IPv6 has long been the new standard for IP addresses. Nevertheless, it is often still neglected in many companies. Many companies face the requirement to filter out IPv6 addresses as internal traffic in Google Analytics 4. However, the entire documentation primarily focuses on IPv4 addresses, and even the GA4 interface treats IPv6 addresses as a minor issue. If you still need to filter out IPv6 addresses as internal traffic, we’ve compiled some useful information for you below:
In principle, all operators for filtering internal traffic with IPv6 addresses can currently be used in GA4. However, Google itself has so far provided only one example of CIDR notation in its documentation regarding IPv6 address filtering.
Quote: “If you are using IPv6 addresses and want to specify a range, use the same ‘slash’ suffix to indicate how many bits of the range are fixed. For example, if the range is 0:0:0:0:0:ffff:c080:ff00 – 0:0:0:0:0:ffff:c080:ffff, specify it as 0:0:0:0:0:ffff:c080:ff00/120 (the first 120 bits are fixed).”
I'll explain this in more detail using the following example. The following IPv6 addresses should be filtered out as internal traffic in the future:
2001:9e8:c048:1d00:286c:6432:85af:efc3
2001:9e8:c048:1d00:286c:6432:85af:efcf
2001:9e8:c048:1d00:286c:6432:85af:efe8
2001:9e8:c048:1d00:286c:6432:85af:effa
First, we need to determine the range that these IP addresses fully encompass. In this example, that would be the range from
2001:9e8:c048:1d00:286c:6432:85af:efc0 to 2001:9e8:c048:1d00:286c:6432:85af:efff
To convert this to CIDR notation, we use appropriate online tools, such as an IPv6 subnet calculator. With just a little prior knowledge of subnets, I can quickly determine that the CIDR notation is:
2001:09e8:c048:1d00:286c:6432:85af:efc0/122
122 bits of the IP address are defined as mask bits, which means that 64 addresses in this range would be filtered out for internal traffic in the future.
But is this properly taken into account in the new world of Google Analytics 4?
While there is still a corresponding entry in the Google Analytics Help for Universal Analytics, there is currently no documentation on this topic for GA4. It is well known that IP anonymization in GA4 is now performed automatically and no longer needs to be configured. However, when filtering out internal traffic, this anonymization no longer needs to be taken into account. Here, you can specify the full IP addresses or IP ranges, and only this traffic will then be filtered out.
This is an improvement over the logic in Universal Analytics, where IPs could only be filtered up to the anonymization level. With IPv6 addresses, this resulted in a disproportionate impact when masking the last 80 bits, leading to an excessively large address space being excluded. Google has now clearly found a much better approach to IP anonymization in GA4.
One final important note on testing
Google points out that filters can take up to 24 or even 48 hours to take effect. Occasionally, however, a filter takes effect immediately. This can tempt you to start testing too early. Since filters do not reliably take effect immediately, test cases should be planned carefully and executed with sufficient time. A good best practice tip here is to alternate between positive and negative test cases. This way, you can reliably determine from the testing data (in the “Test data filter name”) in GA4’s real-time traffic whether the newly configured filter is already active.
Digitalisation is progressing relentlessly, and with it the ongoing development of network technologies. IPv6 addresses are becoming increasingly important, as the IPv4 address space is slowly being exhausted. But how does this fit into the world of Google Analytics 4, which was primarily designed for IPv4? Using IPv6 in GA4 brings both opportunities and challenges. In this blog post, we explore how to use IPv6 addresses in GA4 to filter internal traffic and look at the hurdles that arise from GA4's focus on IPv4.
IPv6 has long been the new standard when it comes to IP addresses. Nevertheless, it is still often neglected in numerous companies. Many organisations must face the requirement of filtering out IPv6 addresses as internal traffic in Google Analytics 4. Yet the entire documentation revolves mainly around IPv4 addresses, and the GA4 interface also treats IPv6 addresses as a marginal case. If you nevertheless need to filter out IPv6 addresses as internal traffic, we've put together some useful information for you below:
In principle, all operators for restricting internal traffic with IPv6 addresses can currently be used in GA4. However, Google itself has so far only provided one example of CIDR notation in its documentation on IPv6 address filtering.
Quote: "If you are using IPv6 addresses and want to express a range, use the same 'slash' suffix to indicate how many bits of the range are fixed. For example, if the range is 0:0:0:0:0:ffff:c080:ff00 – 0:0:0:0:0:ffff:c080:ffff, specify it as 0:0:0:0:0:ffff:c080:ff00/120 (the first 120 bits are fixed)."
With the following example, I'll explain this to you in more detail. The following IPv6 addresses are to be filtered out as internal traffic in future:
2001:9e8:c048:1d00:286c:6432:85af:efc3
2001:9e8:c048:1d00:286c:6432:85af:efcf
2001:9e8:c048:1d00:286c:6432:85af:efe8
2001:9e8:c048:1d00:286c:6432:85af:effa
First, we need to determine which range fully encompasses these IPs. In this example, that would be the range from
2001:9e8:c048:1d00:286c:6432:85af:efc0 to 2001:9e8:c048:1d00:286c:6432:85af:efff
To convert this into CIDR notation, we use appropriate online tools, so-called IPv6 subnet calculators. With minimal prior knowledge of subnets, I can then quickly work out that the CIDR notation is as follows:
2001:09e8:c048:1d00:286c:6432:85af:efc0/122
122 bits of the IP are defined as mask bits, meaning 64 addresses in this range would then be filtered out as internal traffic in future.
But is this properly accounted for in the new world of Google Analytics 4?
While for Universal Analytics a corresponding entry can still be found in the Google Analytics help centre, there's still no documentation for GA4 on this. It's widely known that IP anonymisation in GA4 is now applied automatically and no longer needs to be configured. When filtering out internal traffic, however, this anonymisation no longer needs to be taken into account. Full IP addresses or IP ranges can be entered here, and only that traffic is then filtered.
This is an improvement on the logic of Universal Analytics, where IPs could only be filtered out up to the degree of anonymisation at most. There, this made filtering with IPv6 addresses have a disproportionate impact, with masking of the last 80 bits resulting in a far too large address space being excluded. Here, Google has evidently found a significantly better approach to IP anonymisation with GA4.
One important note on testing to finish off
Google points out that filters can take up to 24 or even 48 hours to take effect. Occasionally, however, the filter takes effect immediately. This tempts one to test too early. Since filters don't reliably take effect immediately, test cases should be planned carefully and carried out with sufficient time allowed. A good best-practice tip here is: alternate positive and negative test cases. This way, you can reliably tell from the testing data (in the "Test data filter name") in GA4's real-time traffic whether the newly configured filter is already taking effect.
- Kathrin Fahrland
Analytics Consultantsynaigy
Show email address
Subscribe to the blog now and never miss any news
✔️free ✔️weekly news ✔️expert knowledge
Please accept the corresponding cookies to view this embedded content.
