How to exclude internal traffic from Google Analytics using an IP address filter

on 17th April 2019

(Last updated 23rd May 2024)

Fortunately you can do this quite easily by using the IP address of each location where staff are working and then setting up a filter in Google Analytics which excludes this information.

What is an IP address?

An IP address (Internet Protocol address) is a unique string of numbers assigned to every device that is connected to a computer network and the internet. Although each device is given its own (local) IP address, this will only be used internally by the network (i.e. your home wifi network) and when you connect to the internet through a router, a common IP address will be given to all devices on that network for public use. 

Therefore, when it comes to blocking IP addresses, you only need to find the IP address for the router / network, rather than every individual laptop, desktop and phone.

What is my IP address?

This bit is easy, Google will tell you! Just Google search, “what is my IP address?” and it will display your public IP for you. 

If your company has a range of IP dresses, for example if there are multiple networks used within a large building, you should be able to find out what these are from your IT team. 

You will also need to ask colleagues in other locations to complete the Google search and tell you their IPs. Likewise for freelancers or people working in remote locations.

How to filter your IP address from GA4

In the admin panel, go to Data Streams. Click on your data stream. Then, under Google Tag, click on ‘Configure tag settings’. 

In the tag settings configuration screen, click ‘view more’ and find the ‘Define internal traffic’ option.

Here you will be able to add the IP addresses that you want to filter out from your analytics.

How to filter multiple IP addresses from GA4

If you have multiple IP addresses to exclude then you can simply add new rows for each of them. 

Multiple IPs and subnets of IP addresses can also be excluded using a regular expression, which is a specific sequence of characters, for example:

^192\.100\.0\.1$|^192\.168\.0.*$

This expression is excluding the address 192.100.0.1 and any subnets of 192.168.0.

To use a regular expression, you’d select the Match type ‘IP address matches regular expression’, and you can then enter the expression in the value field.

Certain types of filters can be verified first before implementing, though this is not the case with the IP filter, so you’ll need to save the filter changes and then give it around 24 hours to come into effect. Note that, while on UA you would be able to add different filters to different views (useful if you want to compare data with the internal filter vs data without the internal filter) this is not available in GA4, and whatever internal traffic filter you add, it will be applied at the account level.

 

This article was posted in SEO

  • Emily Owen

    Emily Owen

    Senior Account Manager & Business Development Strategist