Getting More Than One Requirement Out Of Your GA Report Filter

January 16, 2008

The Problem

Do you sometimes want a second report filter at the bottom of your keyword reports?

Report Filter

I do. Every time I want to see phrases containing a particular word, but not containing branded keywords. For example, I might want to see all searches containing “conversion”, but not “lunametrics conversion.” It is a recurring theme for me.


The Solution

So what do you do? It’s called a Lookahead, and it comes in two versions. Positive Lookahead and Negative Lookahead. And we can chain together as many as we want.

Let’s say I want to find all keyword phrases that contain conversion and contain website but do not contain lunametrics. Here is what I’d type into the report filter:

^ (?=.*conversion)(?=.*website) (?!.*lunametrics).*$

The (?! begins a negative lookahead (must not match) and a (?= begins a positive lookahead (must match). The regular expressions inside the lookaheads can be as complex as you want. But if you just want to follow the formula I used here. . .


The Recipe


Start with ^


Place each word you don’t want inside a Negative Lookahead : (?!.*word)


Place each word you do want inside a Positive Lookahead: (?=.*word)


Chain together as many of each as you want

5. Finish up with .*$


This example will match anything with “website” in it anywhere. If you want to match exactly “website” and not “websites” or “123website”, use (?=.*bwebsiteb) instead.