Google Analytics Advanced Filters AND OR

Google Analytics Advanced Filters example - using AND OR regular expressions

Say you run a business energy supply website, and at some point change the URL structure.

Old URL –

New URL –

At a later date you want to compare the performance of the old and new quote pages within Google Analytics.

You also have pages for domestic energy quotes (, for business energy customers (, and a blog with business energy posts (e.g. on-your-business-energy).

First, use the Advanced Filter function to exclude the pages you don’t want in the report:

Exclude – Landing Page – Matching RegExp – home|customer|blog

(The pipe | separates words and acts as an OR instruction, so in the example above we are excluding any landing page URL that contains the words ‘home’ OR ‘customer’ OR ‘blog’)

Next, we want to include any remaining URLs that reference ‘business’ or ‘energy’. To do so we use the following:

Include > Landing Page > Matching RegExp > business.*quote

(The .* expression acts as an AND operator, in this instance looking for any URL that contains both the words ‘business’ and ‘quote’, in any order)