Filters for GA, Part 3a: Easy Implementation/
April 20, 2007
I am writing a series on filters for GA. This is the first actual implementation post I am doing in the series. This one is called “easy implementation,” because it is just implementation of the three “out of the box” filters I wrote about in Part 2. In Part 2, I only wrote about what they do; here, I write about how to make them work for you.
So first, go to the Filter Manager, found in Analytic Settings. And to make this as easy as falling off a wet rock, here is a picture of it:
Notice how you have to click on the white text which has a charcoal background to create a new filter (the top border), not on the blue underlined Learn More. And the next screen will be similar, you have to click on the white “Add filter,” which is on a charcoal background. Hard to see, easier after you have done it hundreds of times.
Easy Filter #1: Exclude all traffic from a domain. Remember that you are excluding traffic based on the visitor’s domain, and that domain has to be an ISP, before you start this. Here, let me be more clear: you can’t use this filter to exclude all the traffic from Google — it will only exclude the traffic from people who work at Google. Don’t remember this? Well anyway, your screen looks like this:
All you need to do is give the filter a name (and it just needs to be descriptive so that you’ll remember it). Then, use the drop down box to choose “Exclude all traffic from a domain.” Only the final part might be hard — the domain. (In fact, I would love to get email/comments from anyone who actually uses this functionality.) When you screen out a domain, and it is an isp, you are going to exclude a *lot* of traffic. Did you really want to exclude everyone from Verizon? From Microsoft?
Well, let’s say that you do. You can keep your RegEx simple, and merely type in Microsoft. Regular Expressions are greedy though, and will include Microsoft.com and Microsoft.ca and anything else. If that’s what you want, great, and if not, make them specific: microsoft.com or if you are really compulsive, microsoft.com$. Need to understand how to use the characters that make up the Regular Expressions, like the backslash and dollar sign?
Easy Filter #2: Exclude all traffic from an IP address. This is a much more selective way of excluding traffic. You’ll do it the same way as above: First you give the filter a name that is meaningful to you, then you choose “Exclude all traffic from an IP address” from the drop-down box, and finally, you create the regular expression that defines your IP address(es). You might just have one, like this: 22.214.171.124, in which case, you’ll write it like this 126.96.36.199 , thereby turning the magic dots into simple everyday dots. Or maybe, you have a range of IP addresses – you can still get them into that one box by using Regular Expressions. So if you own IP addresses 188.8.131.52 through 184.108.40.206, inclusive, you’ll write ^72.77.12.(2[6-9]|3[0-9]|40). If this is complete gobbledygook to you, the way it was to me a year ago, check out this post on Regular Expressions – the same example is used there.
Easy Filter #3: Include only traffic to a subdirectory. So it’s the same drill. First you give the filter a name that means something to you, then you choose “include only traffic to a subdirectory” from the dropdown box, and finally, you create a regular expression that defines the subdirectory. For example, if I only wanted to see traffic to this blog, which is now at http://www.lunametrics.com/blog, I could do it a few ways, but the safest would be like this: ^/blog/
Why? The carat ensures that the directory has to start with the word blog. And because there is a slash after the word blog, the RegEx will stop working at that point — it won’t pick up another random directory calling, for instance, blogging.
And now how do I apply these easy filters? You created extra profiles, right? So use the bottom half of that Filter Manager screen and choose which profile to add the filter to. Alternatively, you can just start with a profile and create a filter for it. (But you still have to find the white text on the charcoal background to Create a Filter.)
Check your filters the next day to see if they are working correctly. If you pull in only the new day’s data, you’ll be sure that you don’t have any unfiltered data. Do they make sense? Compare them to unfiltered data over the same time period – does the difference make sense?