Mistakes With Include Filters

August 28, 2009

There is one particular mistake I see over and over with regard to setting up filters in Google Analytics.  This has been talked about before, but it comes up so often that I don’t feel bad about addressing it again (and again, and again).

The Mistake

Multiple Include Filters, causing no data to get into the profile.

What it looks like

1. Include – Request URI – /page.html

2. Include – Request URI – /other.html

What is intended?

The person that adds these 2 filters to a profile wants to include both /page.html AND /other.html.

But why doesn’t that work?

The Technical:

When GA processes filters it does so, sequentially, one at a time.  Filters are like a series of gates, in-line, along a road. In order for data to get from point A to point B, it has to pass through each gate in turn. If there is any one gate that it can’t get past, then no point B and it doesn’t end

Create New Filter - Google Analytics

up in the profile.

Each Include filter can be thought of as an “Include Only” filter.  Let’s look at the 2 example Include filters above with that wording in mind, and see how far our data makes gets.

Data –> A) /page.html, B) /other.html, C) /index.html

1. Include – Request URI – /page.html
2. Include – Request URI – /other.html

The first thing that happens is our data is checked against Filter 1.

Filter 1 says “Include ONLY data that has a Request URI that matches /page.html”
Data A matches /page.html
Data B does not match /page.html
Data C does not match /page.html

Now we have
Data –> B) /other.html, C) /index.html   -> didn’t make it past the filter
1. Include – Request URI – /page.html
Data –> A) /page.html
2. Include – Request URI – /other.html

The only piece of data that made it past Filter 1 was Data A, /page.html

Now it is tested against Filter 2, which says “Include ONLY data that has a Request URI that matches /other.html”

/page.html, is tested against Filter 2, /other.html.  It does not match, and ends its trip short.

So, no data in our set can possibly make it past both filters, since there is no single page that can match BOTH /page.html AND /other.html

Just above the enter key

The Solution

The solution is to use a single filter that looks like this:

1. Include – Request URI – /page.html|/other.html

We put both pages that we want to include into a single filter and seperated them with a pipe.  The pipe is the vertical bar symbol usually located just above the Enter key.  This is a Regular Expression (RegEx) symbol that can be read as “Or”.  So the filter says Include ONLY pages that match either /page.html OR /other.html.