How to Exclude IP Addresses in Google Analytics 4

Posted in: Analytics

Join thousands of marketers to get the best search news in under 5 minutes. Get resources, tips and more with The Splash newsletter:

When working in the world of website analytics, you might find yourself visiting a client’s website 5, 10, or maybe even 15 times a day. These website visits from data analysts like yourself can skew your data, especially if you are working with a business receiving low website traffic. For more accurate Google Analytics 4 results, you will want to exclude the IP addresses of all the analysts at your company monitoring the website performance of a client. 

IP Address Collection in GA4 


To align with the most up-to-date data privacy laws, IP addresses are not stored in GA4. IP anonymization is automatically turned on in Google Analytics 4 and can’t be changed.  


However, despite the IP anonymization features of GA4, you can still block specific IP addresses from internal traffic. Blocking an IP address will not allow any website actions from a user to show up in GA4. 

The Steps 

There are several ways you can exclude an IP address. The method below details how to block an IP address using the settings within GA4. 

Part 1: Define Internal Traffic 


  1. Admin > Data streams > Click on the data stream for your website


      data stream

2. Configure tag settings > Show more > Define internal traffic 

internal traffic

3. Create >  Fill out all the fields in the Configuration window > Create

Fields to complete include the following: 


Rule Name: [any unique name you want to use to define the IP address you are excluding] 

  • traffic_type value: internal 
  • Match type: IP address equals 
    • Use IP address matches regex if filtering multiple IP addresses 
  • Value: [the IP address number] 
    • You can use a site like What is my IP address to find your IP address number. 
    • You can string multiple IP addresses together in the value box by creating a regular expression. If you are not a regex expert, you can ask ChatGPT to combine multiple IP addresses together as a regular expression. 


Part 2: Create a Data Filter 


Now that you have defined what internal traffic should be excluded, you want to follow the steps below to create a data filter so this internal traffic is actually blocked. 


1.Admin > Data filters > Create filter 

ga4 data filter

2. Internal Traffic > Fill out the Filter details > Create 


Fields to Complete include the following: 


  1. Data filter name: [any unique name to define the filter] 
  2. Filter Operation: Exclude 
  3. Parameter Value: [whatever value you put for traffic_type value in Part 1] 
  4. Filter State: Active 


internal filter creation



After following the above steps, you should notice a drop in the number of users in GA4, which indicates that you correctly blocked the IP addresses. Excluding IP addresses gives you the freedom to open and click on websites all you want without worrying about messing up data integrity. 


Search News Straight To Your Inbox

This field is for validation purposes and should be left unchanged.


Join thousands of marketers to get the best search news in under 5 minutes. Get resources, tips and more with The Splash newsletter: