The Ultimate Guide to Google Analytics Profile Filters

The Ultimate Guide to Google Analytics Profile Filters

Segmentation is the key to greater understanding of your Web Analytics data. If you only look at overall bounce rate, e-commerce conversion rates, or any other metric alone, you miss out a lot!

Google Analytics offers 3 main ways to segment your data: custom variables, advanced segments and profile filters (there are many other ways of segmenting the data, like secondary dimensions or other filter types that can be applied to data, but they are less powerful). As the title already suggests, this article aims for uncovering the exciting world of profile filters. But below is a very quick comparison between the three most important ways to segment the data:

Profile filters belong to a long term segmentation strategy. The data collected in a specific profile in the past cannot be changed or removed, so please be careful when applying filters.

Advanced segments on the other hand, allow you to apply and remove segments without removing data. They are considered less effective for long term segmentation purposes.

Custom Variables can be used to define additional segments to apply to your visitors other than the ones already provided by Analytics. It is a powerful technique as it can be tailored to a website and its idiosyncrasies but, on the downside, it depends on additional website coding (here is a detailed explanation).

Important Facts to Know About Profile Filters

Probably the most important thing to keep in mind: the effects of applying Google Analytics profile filters cannot be undone. That’s why I always advise to keep a raw data profile within your Google Analytics account. In case something goes wrong, you always have a backup profile. In addition, a new feature, the Google Analytics Change History, will help you monitor changes made by any user to your profile filters.

If you are unsure about how a profile filter works, it is a good idea to test it in a secondary profile first. As Daniel Waisberg wrote on this article about implementation: “The best way to learn how filters affect your Google Analytics data would be to have two profiles with the exact same settings (the real profile, and the test profile) and apply a new filter only to the test profile. Once it is applied, you can check the data and compare the number to learn if anything went wrong. Here is an article from the Google Analytics Help Center on how to add profiles.”

Since last year, profile filters are also applied to Google Analytics real time reports; this is a significant help when testing new filters. So when you create a new profile filter you can watch the results in real time and, if you made a mistake, correct it in real time.

Two Types of Profile Filters

Over the last couple of years I am amazed by how creative people are when applying profile filters. In general there are two different types of filters: predefined and custom profile filters.

Predefined vs. Custom Filters

A. Predefined filter types

  • Exclude/Include only traffic from a specific ISP domain
  • Exclude/Include only traffic from a specific IP address
  • Exclude/Include only traffic from a specific hostname
  • Exclude/Include only traffic from a specific subdirectory

B. Custom filter types

  • Exclude/Include only traffic based on a specific dimension: related to content and traffic, campaign or ad group, e-commerce, audience/users, location, event, application or custom field.
  • Lowercase/Uppercase: converts the contents of the field to all lowercase or uppercase characters; only affects letters.
  • Search & Replace: search for a pattern in a specific field and replace with an alternate form.
  • Advanced: build a new field from one or two other fields; advanced filters further explained.

By now you have developed a solid understanding on the possibilities of profile filters. It’s time to put things in practice!

10 Useful Google Analytics Profile Filters

I have selected 10 filters that, in my opinion, are very useful for a wide range of web businesses. So I encourage you to use those if they fit your specific situation. This is by no means a complete list; unfortunately, no person on earth can offer you a complete list. At least this will give you a clue about what is possible.

1. Include Your IP Address

It can be very useful to create a profile with an include filter on your IP address. Actually, in all of the Google Analytics accounts I have access to, this filter is present. For me this is a great way to test goals, filters and even a complete implementation.

You have to take into account that if you work at a large company there is a huge chance that others are on the same IP address as yours. The filter looks as follows:

Include Only Traffic from IP Address

2. Exclude IP Addresses

The exact opposite of the include IP filter is a great one as well. Excluding visits from your own company or any known third party is very important when setting up your profiles. These visitors generate a huge amount of pageviews and their behaviour is totally different from the “normal” website visitor for which you optimize the site experience.

Think about a large company where everyone sets the company homepage as the starting page in their browser. This can easily impact key metrics like conversion rate, bounce rate and several more metrics. At the end this may lead to bad online marketing decisions. Jusy apply the filter that is shown below to overcome this:

Exclude IP Addresses

If you need to filter out a range of IP addresses, this IP address range tool may be useful.

One important thing to understand is that adding two include IP address filters to the same profile doesn’t work. In case you need to include more than one IP address, you should use regular expressions to set it up as one filter.

Here is a free cartoon eBook (link to PDF) explaining the most useful Google Analytics regular expressions out there to help your further on this topic (by Lunametrics).

3. Include/Exclude Specific Campaign

There are many reasons to use filters on specific campaign attributes. Let’s assume you are running a large cpc campaign and an agency you work with should not have access to this information. You have to use this filter to exclude the cpc data from your profile:

Exclude cpc visitors

In the same way you can apply filters to the campaign source, content, term and campaign name.

4. Lowercase on Campaign Attributes

The larger the company you are working at or dealing with, the more people are probably involved in the campaign tagging process.

First of all it is very important that there is a document and there are strict guidelines on how one person should name a specific campaign. Very often I come across a Google Analytics account with 50 campaign media. A closer look reveals they actually have 10 or less campaign media, but the naming process went totally wrong.

One thing you can do to overcome a part of this problem, is to simply add five lowercase filters on the UTM campaign parameters:

  • Campaign Medium
  • Campaign Source
  • Campaign Content
  • Campaign Term
  • Campaign Name

How to create a lowercase filter on campaign medium is shown below:

Lowercase on Campaign Medium

From now on it doesn’t matter whether the campaign is tagged as “cpc”, “CPC” or “Cpc”. In all cases the campaign medium is registered as “cpc” in Google Analytics. By adding these filters your data becomes more clean and easier to analyze and derive insights from.

5. Lowercase on Request URI

Quite often a website can be reached in more than one way. What I actually mean here is that the URLs can be written both with lowercase and uppercase characters without the webserver performing a redirect.

Take as an example the following two pages of a website: /about-Us/ and /about-us/. The URLs almost look the same and will direct you to the same content, but they will cause two different pageviews to be created in Google Analytics. With the following filter Google Analytics will record both pages as /about-us/:

Lowercase on Request URI

If you have a technical background or are surrounded by technical people that are willing to help, you can solve it in a different way. Unfortunately this is not always the case.

6. Attach Hostname to Request URI

If you have a multidomain implementation of Google Analytics running and collect the data of both domains in one profile, you cannot distinguish the same page names (Request URIs) in Google Analytics in an easy way (drilling down in a report or adding a secondary dimension on hostname will help).

An example: siteA.com/index.php and siteB.com/index.php. In your “All Pages” report in Google Analytics both pages would be registered as /index.php. So in order to distinguish between them you need to rewrite the Request URI and attach the hostname. The filter to accomplish this is shown here:

Attach Hostname to Request URI

A disadvantage of using this filter is that it breaks the links to your website in the content report, i.e. you won’t be able to click on a link that leads from Google Analytics to your website. But since for an implementation with multiple domains you would have to chose only one domain to click on those links, this feature would be less valuable anyway.

7. Include Specific Region(s)

Do you run an internationally appealing website and are you interested in filtering out specific regions? Google Analytics profile filters make this a very easy task:

Include Only Traffic from Three Countries

In this case I use a regular expression to include only traffic from The Netherlands, Belgium and Germany. As you might guess, I live in one of these three countries 😉

8. Include Only Mobile Visitors

We both know that there is a strong growing trend in the percentage of people using mobile to browse the web. A lot of companies are not yet ready for this and have relatively low conversion rates in this segment.

Use this filter if you want to take a closer look at the mobile visitors segment:

Include Only Mobile Visitors

9. Include Only Traffic to Specific Subdirectory

Let’s assume you work at a company that includes a blog on a website section, e.g. /blog. You have hired three content writers that contribute to your website by adding posts to the blog directory.

There are many reasons why you would limit their access to the blog directory. The filter you need to handle this situation is given below:

Include Only Traffic to Blog

10. Include Only Traffic to Specific Hostname

Two reasons why you might place an include filter on your hostname:

  • You are prevented from someone hijacking your Google Analytics profile number and placing it on other domains
  • You can filter out a staging / test domain where the same Google Analytics profile number is running

Here is an example of how you can include only traffic to a specific domain, Exampledomain.com:

Include hostname filter

BONUS! 11. Exclude All Query Parameters

I like to be surprised and to surprise others 🙂 That’s why I am throwing in one more useful Google Analytics filter.

If you are running a website with a lot of technical query parameters I strongly suggest to filter them out from your data in Google Analytics.

This way you can reduce the actual number of pages that show up in Google Analytics enormously and give the data more meaning. If you don’t remove these query parameters the same page will show up too many times. Note: if you are in this situation you need canonical link tags for SEO purposes.

For example: siteA.com/order.aspx?id=100012 and siteA.com/order.aspx?id=100013 are exactly the same pages and you should measure them as one: siteA.com/order.aspx (without the query parameter). Here you can review the filter:

Exclude All Query Parameters

Important to note that this filter eliminates all query parameters in the profile where the filter is applied to. If you have just a few query parameters that you like to eliminate, you can add the query parameters to you profile settings as shown below:

Exclude Specific Query Parameters

Assigning a Filter Order

By default profile filters are processed in the order in which they were added. However, you can easily modify the filter order from the profile settings page in your administrator dashboard.

This is very important since the filter process order is influenced by a combination of two or three filters or one filter influencing the next one. Here you can see where to change the filter order:

Assign Filter Order

Final Thoughts and Tips

Google Analytics profile filters can be very powerful if applied in the correct way. 10 last things to keep in mind:

  1. Always keep an unfiltered profile (for safety reasons)
  2. Always keep a profile with an include filter on only your IP address (for testing purposes)
  3. Profile filters belong to a long term segmentation strategy
  4. Advanced segments are useful for ad hoc segmentation purposes and can set certain limits (more than, less than, equal to) where filters can’t
  5. A good strategy is to first setup an advanced segment and when returning to it often create a separate profile for this specific segment
  6. Apply new filters to a secondary profile filter first before adding them to your main profile
  7. Profile filters help you to give limited access to specific stakeholders
  8. Filters are useful to any type of website (lead generation, e-commerce, service, blogs etc.)
  9. New profile filters don’t work directly; in my experience it can take up to 1 or 2 hours before they actually do their job
  10. Take into account the order in which filters are processed

If you have read the whole post, well done! You are on your way to becoming a Google Analytics profile filter Ninja! 🙂

What’s your experience with profile filters? Any great filters to share? If you like the article, we very much appreciate a comment or share!

Related Content

  1. Understand Google Analytics Advanced Segments
  2. Google Analytics Custom Variables: Segmentation Power
  3. The Choice Is Stark: Segment Or Die!