How to Add Filters in Google Analytics + Why You Should

Google Analytics data can be extremely valuable to your business.  It tells you how many people are coming to your site, how long they’re staying, what actions they’re taking, and which pages they’re leaving the most. This helps you track advertising success, identify problems on your website, and discover more about your audience.

So if your data is skewed, that could cause a whole lot of problems.

That’s where filters come in.  Filters allow you to remove specific information that might skew your data and view information about segments of your audience.  Below, I’ll walk you through how to set up Google Analytics filters and several scenarios in which you might want to use them.

The Basics of Setting Up Google Analytics Filters

You’ll start with the following steps for creating all of your Google Analytics filters:

  1. Log into your Google Analytics account.
  2. Click on Admin.
  3. Click on All Filters.
  4. Click the red Add Filter button.

google analytics filters screen

Using Filters to Remove Your IP Address

One of the things that we encourage our clients to do is remove their own IP address from their Google Analytics data.  This keeps the numerous visits you make to your own website from showing up in your site visits and throwing off your analytics.

The first step is to find out your IP address.  I personally use IP Location.  Then:

  1. In the Filter Name box, name the filter.  An appropriate name might be Sarah’s IP.
  2. Under Filter Type, choose Predefined.
  3. Choose Exclude –> Traffic from the IP Addresses –> That are equal to.
  4. In the IP address box, add your IP address.
  5. Under Apply Filter to Views, choose All Web Site Data, then click the Add button on the right.
  6. Click the blue Save button.

google analytics filters to hide your ip address

You’ll probably want to repeat this process for anyone that works at your organization, assistants, co-owners, that kind of thing.

Using Filters to Hide Spam Traffic

Spam content in analytics is starting to become more and more prevalent.  And spam traffic can be driven from a variety of sources – social buttons, adult websites, etc. – and generate fake data without ever visiting your site.  How?  You can read more about that in this article from Moz.

But you definitely don’t want to include that in your analytics data.  The easiest way to remove the majority of spam traffic is to include only traffic that goes to the domains that you use.  Typically, this would just be your primary domain, but you may also be tracking traffic on YouTube, LeadPages, Teachable, things like that.

Your first step is to compile a list of places that your Google Analytics tracking code is installed.  So, let’s say that my list is the following:


Then, you’ll turn this list into a Regular Expression, which is a term that Google Analytics uses.  Simply type in each domain, then put a backslash (\) before any full stops and separate each domain with a pipe (|). When you’re done there shouldn’t be any spaces between (or in) the domains.

So my list would become:


Notice that I only used the endings of each domain name in the regular expression.

Then you can easily create a filter!

  1. Choose a filter name.
  2. Under Filter Type, select Custom.
  3. Click Include and add your Regular Expression in the field that appears.
  4. Under Apply Filter to Views, select All Website Data and click Add
  5. Click the blue Save button.

google analytics filters to hide spam traffic

You can read even more about preventing spam traffic in this great article from Loves Data.

Using Filters to View a Specific Audience

While you can certainly set up specific audience views using segments, it can be useful to set these up using filters, too, especially if you use them often.

There are a ton of ways that you can set up your filters.  For example, you could create filters for a specific country (useful, especially, if you sell globally), certain device types (like phone, desktop, tablet) or even browser type or Internet connection (great ways to identify issues that might be occurring on certain platforms).

The filter below is an example of how to create a filter for a specific country.

  1. Choose a filter name that’s descriptive.
  2. For Filter Type, select Custom.
  3. Select Include.
  4. Under Filter Field, choose Country.
  5. In the Filter Pattern box, add the name of the country.  In this case, United States.
  6. In Available Views, select All Web Site Data, then click Add.
  7. Click the blue Save button.

google analytics filters for specific demographics

Then, you can easily view all of your Analytics data within the United States.  Since these types of filters are often toggled on/off, you can select All Website Data under Selected Views, click Remove, and then Save to remove the filter.

Feel free to play around with these!  There are a ton of specific options that might be appropriate for your business and website.

Using Filters to View a Specific Type of Traffic

This is a particularly valuable way to utilize Google Analytics filters.  You can create filters to view specific types of traffic, such as referral or direct traffic, visitors you received from social media, or traffic that resulted from a specific ad campaign.

So let’s say that you want to view traffic that originated from a specific ad campaign that you’re running on Google AdWords.  Here’s what you would do:

  1. Add a Filter Name that you’ll understand.
  2. Choose Custom for Filter Type.
  3. For Filter Field, choose Campaign Name (for other purposes, you could choose Social Network, Campaign Referral Type, etc.)
  4. Under Filter Pattern, add your Campaign Name.  You can find this in your Google AdWords account – it’s automatically generated for each campaign that you create.
  5. Under Apply Filter to Views, select All Web Site Data, click Add.
  6. Click the blue Save button.

google analytics filter for campaign name

Again, remember that this is the kind of filter that you would generally use temorarily, so make sure to remove it when not wanting to view specific ad campaign data!


As you can see, Google Analytics filters can be extremely valuable.  They help you truly understand the actions of your audience and clarify data to ensure you’re receiving the most accurate information possible.

If you’d like help setting up your Google Analytics account, let us know OR feel free to get in touch with questions.

By |2018-04-08T01:50:22+00:00April 8th, 2018|Marketing, Web Design|0 Comments

Leave A Comment