Questions
Jun 5, 2023

How to Exclude IP Addresses in GA4?

Learn how to exclude IP Address in Google Analytics 4 (GA4)

How to Exclude IP Addresses in GA4?

When GA4 is set up on your website, it tracks all user interactions, including those from your team members. These internal interactions can skew your data, leading to less accurate insights.

To maintain data integrity, it's crucial to filter out internal traffic, such as specific IP addresses. This article provides an easy-to-follow guide on how to filter out specific IP addresses in GA4.

Steps to Filter IP Addresses in GA4

Step 1: Open Google Analytics and navigate to the Admin section.

Step 2: In the Property column, select Data Streams and choose your data stream

Step 3: Within the web stream details, navigate to Configure tag settings.

Step 4: Click on Show all, then select Define internal traffic.

Step 5: Click on Create to start a new rule.

Step 6: Assign a name to the rule.

Step 7: Define a value for the traffic_type parameter. This parameter is unique as it's the only one where you can set a value. The default value is 'internal', but you can customize it to represent a specific internal traffic source.

Step 8: In the IP address section, select a match type operator and input your IP address. Here are examples demonstrating how to specify IP addresses using different operators:

  • If the IP address is exactly equal to: 172.16.1.1
  • If the IP address starts with: 10.0.
  • If the IP address ends with: .255
  • If the IP address includes: .0.0.
  • If the IP address falls within a certain range (expressed in CIDR notation):
  • For a 24-bit block (for example, from 10.0.0.0 to 10.255.255.255): 10.0.0.0/8
  • For a 20-bit block (for example, from 172.16.0.0 to 172.31.255.255): 172.16.0.0/12
  • For a 16-bit block (for example, from 192.168.0.0 to 192.168.255.255): 192.168.0.0/16
  • If the IP address aligns with a specific regular expression: 192.0.*

Step 9: Optionally, you can add more conditions. Any IP addresses that meet these conditions will be marked as internal traffic. These conditions work on an OR basis, not AND. Finally, Click Create to finalize the rule.

Step 10: Go back to the Admin section and navigate to Data Settings > Data Filters

Step 11: Click on Create Filter, provide a name for your filter then choose Exclude to filter out events where the traffic_type parameter value matches the name you assigned in step 7 which in 'internal'

Step 12: Set your filter state to Active and finally click Create.

Please note that it can take between 24 to 36 hours for a data filter to apply. If no value is assigned immediately, check back later.

Keep in mind, once a data filter is applied, its impact on the data is permanent. If you apply an exclude data filter, the excluded data will never be processed and won't be available in Analytics. If youTitle: A Step-by-Step Guide to Filtering IP Addresses in Google Analytics 4