Filter out your traffic in Google Analytics

If you're serious about online marketing, you're surely tracking how your website is doing. And there's a pretty big chance you're using Google Analytics for that: it's free, it's easy and it shows you what you need to know.

You and your development team will probably be visiting your own site - a lot. Testing those sales funnels, contact forms and newsletter sign-ups. Those actions should not end up in your Google Analytics profile: it will mess up your numbers, and give you a wrong impression of how your site is doing.

There's an easy way to fix this: filter out your own traffic based on your IP address.

  • Go to the settings of your Analytics view, and click on Filters.
  • Click Add filter
  • Select Create New Filter
  • Enter a name for your filter, like ACME Office IP Filter
  • Select Predefined
  • Set the filter to Exclude, and select Traffic From IP Address, and That are equal to
  • Enter your IP address. Don't know what your IP address is? Just go to whatsmyip.org.
Google Analytics IP filter settings

That's it, all traffic from that IP address will no longer show up in the reports.

Pro tip: always create a raw data view that doesn't have any filters. This will serve as a back-up. If you accidentally filter out too much data, there's no way to get that data back in by removing the filter. The Raw Data view will still have that missing data.

While we're at removing incorrect data: if you have a development, testing or staging environment where your product is being tested, create a separate Analytics property for those environments. That's will not only keep your testing activity out of your live Analytics profile - it also lets you test your Analytics settings.

Here's a quick way to do that if you're using Google Tag Manager:

Create a new custom variable called Google Analytics Tracking Code, of type Lookup Table. We'll use this variable to set the tracking code based on the URL of the website.

Lookup table with local, testing and live hostnames in Tag Manager

Next, go to the Google Analytics Settings variable, and select the Google Analytics Tracking Code variable you just created.

Variable Google Analytics Tracking code

That's all, no longer will your live Analytics profile be ruined by testing data and your own traffic.