Do you want actionable Internet Marketing advice delivered right to your inbox?
Sign up for our Newsletter

The TechWyse ‘Rise To The Top’ Blog!

Experts from TechWyse and around the world offer how-to's, strategy advice, interviews, infographics and insights to help your SEO and internet marketing campaigns Rise To The Top!

Three Reasons To Use Regular Expressions in Google Analytics

Website Analytics April 21st, 2010



A regular expression (affectionately called “RegEx”) is a string that many of us Google Analytics geeks use to describe or match a set of strings based on certain syntax rules. Google Analytics (GA) supports regular expressions so that users can create more powerful implementations.  In this article I am going to discuss the three main usages of RegEx in Google Analytics.

RegEx in Google Analytics

1. Creating Filters In Google Analytics

Filters in GA are more advanced and is useful for getting some very refined reports. One of the most used filter application in GA is excluding IP addresses.  This allows us to strip out the internal traffic from the GA report. Individual IP’s can be excluded with predefined filters. By using custom filters we can block a range of dynamic IPs . This can be done by defining a proper RegEx format to get the entire IP series blocked.

Are you not a RegEx geek? Not sure about the expressions of quantifiers & repetitions? No worries. Google has a tool to automatically generate the correct regular expression for your range of IP addresses.

How will you make sure that you filtered out all internal IPs? Recently our very own GA wizard Jon has written a post on this titled “making sure specified RegEx format filters all internal IPs”.

2. Setting up Goals in Google Analytics

Goal set up is used to measure the number of conversions that a website is getting.  Most conversions we use help us understand how many form leads are being received.  To do this we need to choose a goal page which loads after the visitor completes the desired action. You may need to track many actions under one goal setup which have different goal pages. If that is the case the goal page should be defined in regular expression format so that Google Analytics will register goals when users complete all the desired actions which you want to be completed.

For example, the following are the pages that come after the desired actions.

Exact regular expression will match all the above three goal pages is “/.*/signup\.html” or “signup\.html$”

3. Filtering Data Within The Report Interface

Most Internet marketers love getting the Google Analytics keyword report to see the search terms that visitors used to reach the website. While reporting to this client, we at TechWyse like to filter out brand name searches in the keyword report.

This regular expression (tech\s?wyse) matches the following terms and strips them out from report.

“techwyse, techwyse.com, tech wyse”. This is an example and can be used in any Google Analytics report.

And so this ends my session on using regular expressions in Google Analytics.  I hope it helps!

Post By Elan (18 Posts)


Elan has been applying his Internet Marketing and Web Analytics skills for over 11 years and has been sharing some of that experience here on the TechWyse blog!

Post a Comment

Send me SEO tips!




Like us on Facebook

TechWyse Internet Marketing

Three Reasons To Use Regular Expressions in Google Analytics

Read time: 2 minutes