Skip to content

How to exclude internal traffic in GA4

Contributed by

SaaS Hackers
Blog

Excluding traffic from your office and staff's home addresses is recommended to ensure you are not muddying your website analytics data. Especially if your website doesn’t get a lot of traffic.

Assuming you have Google Analytics configured correctly then setting up your internal traffic filters is fairly straightforward. Here is how you do it in a few simple steps.

Step 1: get a list of IP addresses

Probably the quickest way to do it is typing “what is my IP” into Google. Get everybody to do this in the location you want to exclude, you will then have a list of dedicated IP addresses to exclude from website traffic.

Google search for "what's my ip?" showing the public IP address box, with the address blurred
Simply google "what is my IP" Google does the rest.

Step 2: Create a filter in your Data Stream

Go to your admin panel in Google Analytics and go to Data Streams.

GA4 Admin screen with Data Streams highlighted in the property column
Select your data stream

Once you have selected your data stream (usually you will only have one for a website).

GA4 data stream Google tag section with the Configure tag settings option

In your tag settings, you need to select ‘more’ and then select ‘define internal traffic’.

GA4 Google tag settings list with the Define internal traffic option at the bottom

You then can create a filter for your internal traffic. To simplify things it's better to have one filter for each IP so that you can name them all and see which IP relates to which location.

GA4 Define internal traffic form with rule name, traffic_type value of internal and IP address match fields

What this does is tag that traffic with a value of ‘internal’. You then have to go back into the admin panel and under ‘data settings’ go to ‘data filters’ and create one for “internal traffic’.

GA4 Data Filters screen with an active Internal Traffic filter set to exclude

When you create this filter it basically creates another filter on a filter if that makes sense. So this creates a filter for everything which is tagged as ‘internal’. You then have to set this filter to ‘Active’ to make it work.

If you create the filter in the data stream but don’t create this filter you will still see the internal traffic.

GA4 Edit data filter form excluding events where traffic_type is internal, with the filter state set to Active

And that's it! It shouldn't take too long when you have the IP addresses. That is probably the bit which will take the longest to get. Happy filtering.

Contributed by

SaaS Hackers

Find a B2B SaaS Expert

We've collected a directory of B2B SaaS experts and agencies that we've reviewed and categorized based on service and specialism for your review.

Find an expert
View all