REGEX TOOL: The Regexinator, A Google Analytics RegEx Include Filter Compiler/
December 18, 2012
If you’ve ever had to string together multiple phrases for a RegEx filter in Google Analytics, you know how much of a pain it can be to assemble. You have to get all the terms, stick them together with pipes, and escape any RegEx characters in the filter. All of this can become very time-consuming, and woe upon you if you have to do this multiple times.
Enter the Regexinator, a Google Analytics regex generator that takes long lists of words or phrases and generates 255 characters snippets of properly formatted RegEx-style terms. Click here and download it now!
How the Regexinator works
First, download the sheet and open it in Excel. Once you’ve opened it, gather the terms you’d like to create filters with and paste them under Terms in Column A. Then enter either “Y” or “N” in the box next to “Exact Match?” if you wish to only see results that match exactly your terms. Your filters will appear under ‘Results’ in Column E – you’ll only be able to use one cell per include filter, since they’re built to be or get as close to being 255 characters, the maximum number Google Analytics allows for RegEx. Not sure how to use more than one include filter? You just create a new custom segment under the Advanced Segments option on Google Analytics.
Why would I ever need this?
I can think of plenty of hypothetical scenarios that this might come in handy – but let me share mine with you. I needed to find the most profitable product for an ecommerce client of ours in Google Analytics. Unfortunately, even though they all shared a category on their search subdomain, they didn’t share a common feature in their URL that I could filter by. Here’s what I mean:
- Red Hat 1 (example.com/redhat1)
- Red Shirt 1 (example.com/holiday/shirts/redshirt1)
- Blue Pants 1(example.com/pants/bluepants)
Since there was no easy way to filter for all of these products, I simply created a filter using RegEx that looked like this:
Red Hat 1|Red Shirt 1|Blue Pants 1
This worked well enough, but would return a bunch of other irrelevant products that contained similar terms. So then I created them in an exact match format:
^Red Hat 1$|^Red Shirt 1$|^Blue Pants 1$
That got me the information I wanted. Now picture doing this 20-30 times, and you begin to see why an Excel tool that does the heavy lifting for you comes in quite handy.
Is this a solution you’ve been looking for? Let us know in the comments.