Learn how to easily filter traffic by a specific IP (including your own IP) from the Google Analytics reports.

How to exclude a specific IP address from Google Analytics

While working on a shared project with a friend that is starting in the world of the internet, i quickly noticed how the traffic of the webpage that we built had a really interesting spike of traffic in the first weeks. I remember how difficult it was to increase the traffic of a website when i started with Our Code World, so the traffic of the new project was really curious. After reading in detail from where the traffic came from, i discovered that all the traffic was coming from specifically the city where we live (yeah, he was visiting his own page quite often 🤣). This forced me to look for a way to remove the traffic from his house to the project. Fortunately, Google Analytics offers a really easy way to do this from their administration panel.

In this article, we will explain you how to filter the traffic from a specific adress in Google Analytics.

1. Know the IP to filter

Most of the times, you will want to filter your own IP so the reports won't include your own visits. You can obtain your own IP easily using some online services like whatsmyip or even searching for the same word on google will reveal your IP:

What's My IP

In this case, the public IP is 172.254.124.231, so we can continue now that we have the IP.

2. Go to the administration panel

Now, open Google Analytics and access the administration panel pressing the Gear icon at the bottom left side of the screen:

Admin Settings Analytics

This will open the administration panel of Google Analytics in your account.

3. Open Filter of your Property View

As usual, there's a view created for every property (domain or appication) that you have registered in Analytics. So now proceed to open the filters area of that view:

Analytics Filter

4. Create filter to view (excluding by ip etc)

As next, in the filters area of your view, you will be able to create multiple filters. Click on Add filter:

Create Filter Analytics View

Then, select the Create new Filter option and fill the information. You can declare a name for your filter as you will be able to use it in other views or properties as well. In our case, we will name it Filter Own IP and then, in the filter type, use one of the predefined filters that allow you either to include only or exclude specifical stuff like:

  • Traffic from the ISP Domain
  • Traffic from the IP addresses
  • Traffic to the subdirectories
  • Traffic to the hostname

In this case we will exclude the traffic from an IP address:

Add Filter by IP Analytics Traffic

Then click on save and the fillter will be applied to the view.

One thing that you need to know is that all the already stored data will be still contaminated with the IP addresses that you are filtering, but new visits registers won't. By doing this, you will start obtaining more accurate information to improve your marketing data analytics and increase website traffic.

Happy coding ❤️!


Senior Software Engineer at Software Medico. Interested in programming since he was 14 years old, Carlos is a self-taught programmer and founder and author of most of the articles at Our Code World.

Sponsors