Author

Analytics Expert. Passionate about SEO and User Experience or what he calls UX-SEO

Follow me on

How to Filter Static and Dynamic IPs In Google Analytics

Internal traffic is the number 1 reason of inaccurate data. You may say, hey! what about the spam, well that's the second. Despite being annoying, the spam can be easily identified after it hits you, whereas the internal traffic is really hard and in some cases almost impossible to detect so it will be mixed with your real visits.

What is Internal Traffic in Google Analytics?

Internal traffic is all the traffic generated by you or any member of the team working on yours or your company website. These hits are registered in your Google Analytics as if they were coming from a real visitor.

This can make a lot of damage, especially in small-medium sites, because later is hard to differentiate which visits are real and which come from people working on the site. That is why it is very important to filter all internal traffic.

Excluding Static IPs

This method will be useful for most of the sites. To create this filter, you will need the public IP of the network/wifi you want to exclude. An IP address is a number that uniquely identifies computers and other devices.

You can find it here or just search "my IP" in Google. You will see something like this  12.345.678.90 (IPv4) or a longer version with more numbers (IPv6), both are allowed.

Excluding a Single IP or Multiple IPs from Different Locations

With this method you can either exclude a single IP or a IPs from different locations, for example, your home, office, developer, etc, you can use the same filter to block multiple IPs by creating a regular expression.

To do that you need to add a pipe or vertical bar | after each IP like this (only between the IPs never at the beginning or end of the expression)

12.345.678.90|34.567.890.12|11.222.333.44

Note: Dots are considered special character in REGEX, so strictly speaking you need to add a backslash before every dot like this 12\.345\.678\.90 , however, this filter will work without them.

Once you have your public IP or expression with multiple IPs you can create the filter.

How to create a filter for internal traffic

  1. In the Admin Section under the VIEW column, select the view where you want to apply the filter from the dropdown and click on Filters
  2. On the filter window, select Custom as Filter Type.
  3. Under Exclude select IP Address as Filter Field.
  4. Copy your IP or IPs expression in the Filter Pattern box.
    how to exclude internal traffic in Google Analytics
  5. Enter "Exclude Internal Traffic IP" and Save.

You can't verify IP filters the same way the spam filters. To test your filter visit your site from the location you just excluded and check if you are not showing in the real time report, if you still see your visit, wait some time, it may take up to 24hrs.

If your filter doesn't work after this period, check if you enter the correct IP or if you have a misplaced or extra character in the expression.

Excluding a Range of IPs

If you are in a large company it's likely that you will have a range of consequent IPs, to avoid haveing to enter every IP you can create a filter with a more advanced regex.

2 How to exclude a range of IPs in Google Analytics 

(Don't confuse with the internal IPs, If all the computers use the same Public IP you should use the first method)

  1. Follow the first 3 steps of the single IP filter above.
  2. To create the IP range REGEX we will use this Expression Builder
    Google Analytics IP Addresses Regex Builder
  3. Copy the expression generated on the Filter Pattern Box
    Exclude range IPs in Google Analytics

Excluding Internal Traffic with Dynamic IPs

Sometimes your internet provider will assign you a different IP every few days, or maybe you are constantly on the road or working from different places. In this case, the Previous methods won't work unless you keep updating the filters, which is a waste of time.

Excluding Dynamic IPs with a browser extension (Only Chrome)

I recommend you using it only if you don't have another choice. The reason is because you sometimes might one to check filters or do some tests, or simply you want to monitor internal traffic in a different view and this extension won't allow ti.

To use this solution you just simply have to install this extension on your browser and enable it for your site.

Excluding Dynamic IPs using GTM and Cookies

Coming Soon... I'm preparing the tutorial and Screenshots to apply this solution.

Author

Analytics Expert. Passionate about SEO and User Experience or what he calls UX-SEO

Follow me on
Be the first to comment :)