Follow Brian Li (@DecryptoBL) on Twitter.
Follow Brian Li (@bwhli) on Instagram.

How to Filter Your Own Internal Traffic in Google Analytics

July 7, 2015

If you’re like me, and spend a lot of time on your own blog, chances are you’re unknowingly skewing your Google Analytics data. This can often lead to exaggerated page views, among other things. Fortunately, there’s an easy way to filter out your own traffic from Google Analytics reports.

Finding Your Public IP Address

First, you’ll need to find your public IP address. To do this, just type “what is my IP address” into Google. For the purpose of this tutorial, I’ll be using 93.103.172.109 as my IP address.

Configuring Google Analytics

google-analytics-all-filters

Next, click on the Admin tab in your Google Analytics dashboard. Navigate to the Account section of the page, and make sure the correct account is selected. Next, click on All Filters.

Now, click on +New Filter, and you should see a page that looks something like this.

Using Predefined Filters

google-analytics-predefined-filters

If you’re just filtering out one IP address, using a predefined filter with the following settings is the easiest solution.

  • Select filter type – Exclude
  • Select source or destination – traffic from the IP addresses
  • Select expression – that are equal to
  • IP address – your public IP address (93.103.172.109 in my case)

Next, you’ll want to add all the the necessary available views to filter from. Since I use the same Google Analytics account for four of my websites, I have four instances of All Web Site Data under Available Views. I want my home IP address to be filtered for all my sites, so I have added all four of them to Selected Views. Next, click Save Changes. All done.

Using Custom Filters

If you want to exclude a range of IP addresses, you’ll have to use a custom filter instead. To do this, select Custom for the filter type instead of Predefined. Use the following configuration.

  • Select filter type – Exclude
  • Filter field – IP Address

Next, you need to type in a filter pattern for your IP range. Let’s say you want to filter 93.103.172.109 through 93.103.172.121. It’s not as simple as just typing 93.103.172.109–121. There’s a special syntax called regular expression (regex) you’ll have to follow.

For the IP range 93.103.172.109–121, the filter pattern would look like this.

?³.103.172.(1(09|1[0–9]|2[0–1]))$

Click here for a handy dandy regex generator.

Here’s what a completed IP range configuration should look like.

google-analytics-custom-filters

As with predefined filters, you’ll have to select the necessary web views to filter from. After that, click on Save Changes to complete the process.

Conclusion

If you’re serious about blogging, proper IP address filtering is crucial. Now, you can feel free to view your website as much as you want without affecting your Google Analytics data.


Questions?

Find me on Twitter, or send me an email.