Some time ago I had just set up a new website and added Google Analytics to it. Looking at the Analytics reports page, I noticed a flurry of activity. I couldn't believe that a website I just launched was already getting hits. A sign of success, maybe?

Of course not. I quickly realized that those hits were all coming from the same place, my town. What happened is that I had forgot to set up a filter to remove my own traffic to the website so it wouldn't skew the reports with false hits.

As a website owner, you are going to make frequent visits to your own website, in order to make updates, check that everything works fine, and so on. These visits will all come from your own location, which is identified by your IP address. So, it makes sense to filter out IP addresses associated with your location when setting up Google Analytics.

Setting up this filter may be somewhat complicated and unintuitive for some people, so in this article I am going to describe in detail how to filter a specific IP address from Google Analytics.

The article focuses on three points:

  1. Benefits of filtering your own IP address from Analytics
  2. How to find your own IP address
  3. How to set up a filter

Note: the instructions below refer to the new Google Analytics 4 (GA4) setup introduced by Google recently. Steps to set up a filter for the old Google Universal Analytics (UA) may differ slightly, although the main concepts are the same.

Let's jump right into it!

But, first, why should we filter our own IP address in Google Analytics?

Benefits of filtering your own IP address

Filtering your own IP address in Google Analytics has several benefits:

  1. You get accurate data. There's a good chance that you are going to visit your own website often to make updates, test functionality, and check that everything is working smoothly. These personal browsing activities are recorded by the Analytics software and may skew the overall picture of how people browse your site.

  2. Improved conversion tracking. Google Analytics lets you track conversions, that is, browsing activity that hits a conversion target. For example, a conversion target could be the number of sign-ups, or sales, etc. You may actually perform these types of activities yourself on a regular basis, to test the system, and this data gets treated like a real conversion, while in reality it's fake and shouldn't be counted towards normal site interactions.

  3. Data Privacy. By excluding your IP address, you prevent personal information associated with your own browsing activity from being stored in Google Analytics, promoting data privacy compliance.

So, we have seen so far that there are good reasons why you should filter out your IP address, but how are you going to do it?

What is your IP address?

The first thing to do is to find out your own IP address if you don't already know it.
An easy way is to fire up your web browser and go to this website:

http://test-ipv6.com/

Screenshot of how to find your own IP address

Take note of the number appearing next to: "Your IPv4 address on the public Internet appears to be..." That's your IP address that you are going to set up in Google Analytics for filtering in the next steps.

Note that there may be two kind of IP addresses listed: IPv4 and IPv6. This refers to two different versions of the internet protocol used to exchange data between computers.

Either number can be used in Google Analytics, but for our purposes, we are going to use the IPv4 address, which is a sequence of four numbers separated by periods.

Now that you know what your IP address is, let's set up a filter in Analytics.

How to create a filter

To create a new filter for your IP address, follow the steps below. These steps are current at the time of writing, but note that Google may change some details over time. However, the overall sequence of steps should stay more or less the same.

  1. Go to analytics.google.com and sign in using your Google credentials.
  2. Select the GA4 property that corresponds to the website you want to filter your IP for.
  3. In the left-hand navigation sidebar, click on the Admin link.
  4. Under the Property column, click on Data Streams. Here you will see all the streams associated with your property.
  5. Click on the data stream that corresponds to your website.
  6. In the Web stream details screen, under Google tag, click on Configure tag settings. It will show the settings for your google tag.
  7. You may have to expand the choices under Settings by clicking on the Show all arrow on the right. You should see an entry called Define internal traffic. Click on it.
  8. Click on the Create button next to Internal traffic rules. It will show a form where you can enter the rule name, which is a descriptive name to remind you what this rule is about, and the IP address to filter.
  9. Under IP addresses, you will see a drop-down menu with different conditions for matching the address. If you want to match the exact address, select IP address equals.
    Other options displayed let you filter by the address beginning, its ending, etc. In the Value field, enter your IP address you have noted before.
  10. Click on Create and the rule will be created.

At this point you are done and can log out.

Screenshot of internal traffic filter

This change may take some time to take place, up to 24 hours, so be patient, and come back later to verify that the change works correctly.

Summary

In this how-to article we have seen:

If you found this article helpful, feel free to share it with a friend or colleague. Subscribe to my weekly newsletter to receive articles and other useful information directly in your Inbox. No spam ever.