search ]

How to Exclude IP Addresses from Google Analytics 4?

Your own visits, employee clicks, and other internal traffic can skew Google Analytics data. Excluding those IP addresses takes a few minutes and makes your reports far more accurate.

This guide covers Google Analytics 4 (GA4) only. Universal Analytics was fully shut down on July 1, 2024 and is no longer accessible.

What is Your IP Address?

Most computers connected to the same Wi-Fi network will have the same IP address. You can find your IP address by visiting ipaddress.pro. Do this for each Wi-Fi network you want to exclude from Google Analytics.

If your mobile device has a dynamic IP address, you can exclude these devices using the same method.

What my IP Address?

Excluding Your IP Address from Google Analytics 4

To exclude your IP address from Google Analytics 4, follow these steps:

  • Log in to Google Analytics and select the appropriate GA4 property.
  • Click on Admin (gear icon in the bottom left corner).
  • Under the Data Streams section, select your web data stream.
  • In the web data stream settings, scroll down to find the Configure Tag Settings and click on it.
  • In the next screen, click on Define internal traffic (you might need to click “Show more” on the bottom to see that option).
  • Click the Create button to define a new rule for internal traffic.
  • Give the rule a name (such as “Exclude Office IPs”).
  • Set the “traffic_type_value” parameter to internal.
  • Enter the IP address or a range of IP addresses you want to exclude and click Create.
Exclude IP Addresses from Google Analytics 4

Exclude IP Addresses from Google Analytics 4

You can also exclude a range of IP addresses using CIDR notation (e.g. 192.168.1.0/24). This is useful if your office or network uses a dynamic range of IPs.

Activating the Data Filter

Defining internal traffic only labels matching hits – it does not remove them from your reports. You need to create a Data Filter to actually exclude them:

  • Go to Admin and select Data Settings > Data Filters.
  • Click Create Filter.
  • Name the filter (e.g. “Exclude Internal Traffic”).
  • Under Filter operation, select Exclude.
  • The parameter traffic_type should already match internal.
  • Set the filter state to Active and click Save.
I recommend testing the filter first by setting it to Testing mode. In Testing mode, filtered data still appears in your reports but is tagged, so you can verify it targets the right traffic before switching to Active.

Data previously collected (historical data) will not be affected. From this point on, hits from the excluded IPs will not appear in your reports.

If you excluded an IP that many people use, you may notice a decrease in traffic numbers, but the data will be more accurate.

If you are looking for a guide on installing Google Analytics 4 on WordPress, I have a separate post covering the full setup.

Summary

Excluding internal IPs from GA4 is a two-step process: define the IPs under internal traffic rules, then activate a Data Filter to actually drop those hits from reports. It takes five minutes and the difference in data accuracy is immediate.

If you also want to track where your AI-referred traffic comes from, check out my guide on tracking AI traffic in Google Analytics 4.

FAQs

Common questions about excluding IPs in GA4:

Does excluding an IP address affect historical data?
No. GA4 data filters only apply to new incoming data. Any traffic that was already recorded before you activated the filter will remain in your reports.
Can I exclude a dynamic IP address from GA4?
Yes, but since dynamic IPs change regularly you will need to use a range. Enter a CIDR block (e.g. 203.0.113.0/24) or use the "IP address starts with" match type to cover the range your ISP assigns you.
What is the difference between defining internal traffic and creating a data filter?
Defining internal traffic tells GA4 which IPs to tag with a traffic_type parameter. The data filter then uses that tag to actually exclude matching hits from your reports. Without the data filter, the traffic is labeled but still counted.
Can I exclude IPv6 addresses in GA4?
Yes. The internal traffic definition in GA4 accepts both IPv4 and IPv6 addresses. Enter the full IPv6 address or use a CIDR range to cover a subnet.
How can I verify the IP filter is working?
Set the data filter to Testing mode first. Then open the Realtime report in GA4 and visit your site from the excluded IP. If the filter works correctly you will see a comparison option in the Realtime report showing those hits are being caught.
Join the Discussion
0 Comments  ]

Leave a Comment

To add code, use the buttons below. For instance, click the PHP button to insert PHP code within the shortcode. If you notice any typos, please let us know!

Savvy WordPress Development official logo