Custom Filters for GA: Part 3d


So now that the basics of custom filters (but NOT custom advanced filters, which will get their own set of posts) have been explored, let’s go through the only two hard parts: What field you are filtering on, and what the Regular Expression(RegEx) might look like. So do you remember this picture? from a couple of days ago:

Google Analytics include filter

Filter Field (which was Campaign Medium in this picture) and Filter pattern (the RegEx) are the two hard fields. IMHO. That’s the topic of today’s post. Now here’s the problem: this can be incredibly boring, especially when you get into all the technographic filters, like browser version. So I have picked a few interesting ones, and I hope that readers will ask questions about others.

I already wrote about Request URI and Campaign Medium. Here are a few other interesting filter fields and filter patterns (RegEx) to go with them:

  • Referral.
  • Why/When. Use this when you want to to manipulate (include, exclude, whatever) referrals that aren’t tagged. Examples: blogs or other sites that might link to you on their own. If you have a whole profile set up that includes referrals only, you’ll be able to use tools like your funnels and know that they are peculiar to just your referring traffic.
    How: Keep your RegEx as simple as possible, but be careful not to be too broad. For example, if you type in just Yahoo, you will get referrals from both and On the other hand, will get you just my yahoo (but only in the US, with the .com ending.)

  • Page Title
  • Why/When. Maybe you have a whole bunch of title tags that are the same. You’ve heard that’s really less than optimal (no pun intended) for your SEO. But you may still want to have a filter to include just these pages, so that you can learn more about how those pages are working.

    How. It’s pretty easy to mess up the RegEx on this one, so for the example above, start with a carat ^ and end with a dollar sign $, and put the whole title tag in the middle. It has to begin and end with the words you specify, once you have those characters. If you can get away with less, great, but only you know that. (I don’t know your site.)

  • Visitor Browser program
  • Why/When. Maybe you only want to learn about your Firefox users. You might want to learn how many visits it takes for Firefox users to convert, and that report isn’t one you can segment. So a filter works.
    How. Type in Firefox. (or for that matter, Opera. Or whatever browser you love/hate.)

  • Visitor Language Settings
  • Why/When: It *would* be very interesting to understand how your French visitors are interacting with your site. Or every more fascinating, how people who speak your language, but live in another country, interact. Like all the people who speak English, but live in the UK or Canada or Australia, etc.
    How: Go into your Marketing Optimization > Visitor Segmentation > Language report, and you will see all the two letter (or two letter dash two more letter) codes that Google uses, especially if you pull your report for a long period of time and have lots of data. Google does not seem to use the W3C standard, because I was unable to get a match on either en-us (English for the US) or zh-cn (Chinese PRC.) I have put a list of languages that I cobbled together here – it is not definitive, but is not a bad start. You can use these codes as your Match Field — type in en and you will be filtering on everyone whose browser is set to English of any kind.

  • Visitor Type
  • Why/When. If you have a report that just includes New Visitors (or the other way around), you can do lots of extra segmentation on that segment. So it’s like a segmentation squared.
    How. There are only two options here, New Visitors and Returning Visitor. But you might as well keep the pattern matching easy — all you need to do is type in either new or returning.

So please post questions here about filter fields that I didn’t cover, which you might be interested in. ALSO, many thanks to Pittsburgh Bloggers and Loose Tea for updating their links to this blog. to be

Our owner and CEO, Robbin Steif, started LunaMetrics twelve years ago. She is a graduate of Harvard College and the Harvard Business School, and has served on the Board of Directors for the Digital Analytics Association. Robbin is a winner of a BusinessWomen First award, as well as a recent Diamond Award for business leadership. You should read her letter before you decide to work with us.

Contact Us.


24 S. 18th Street, Suite 100,
Pittsburgh, PA 15203

Follow Us



We'll get back to you
in ONE business day.