5 Easy Google Analytics Filters You Can Implement Today

By Kyle Sutton | Web Analytics
Posted October 22, 2015






Easy Google Analytics filters

As they say, your analytics are only as good as your data. Here are five easy Google Analytics filters you can implement today and preserve the integrity of your data. Image © tai111/Dollar Photo Club

There’s no shortage of ways we count on analytics in our day-to-day operations in digital marketing. Whether it’s showing tangible progress in a monthly report or pinpointing the cause of a drop in site traffic, the existence of data – and more importantly, accurate data – can be the linchpin to success here.

It’s for this reason that the data going into your reporting suite (in our case, Google Analytics) needs to be as refined as possible. After all, your analytics are only as good as your data (lest we rely on GIGO). Lucky for us, Google Analytics makes it quite manageable to get a handle on this with a combination of reporting views and filters.

Let’s take a look at five easy Google Analytics filters that you can implement today and take back your data.

A word of caution: we always recommend maintaining a single, unfiltered reporting view for each property in Google Analytics. The default “All Web Site Data” is perfect for this. If you need to test a filter, do so with a new reporting view. Keep that separate view of raw data in case something goes wrong or you need an accurate reference point (remember: filters are permanent!).

1. Exclude internal traffic

This won’t apply to everyone – for example, a small company is unlikely to generate substantial internal traffic to their own website. However, for an enterprise client whose on-site workforce is hitting their site dozens of times a day, those interactions can really start to skew the story of how actual customers are using their website.

Nip this problem in the bud and set up a new reporting view in Google Analytics that excludes internal traffic. If you’re only excluding a single IP address, you can set up a simple predefined filter:

Exclude Single Internal IP

If you want to exclude a range of IPs or feel the need to flex your RegEx muscles, you can use a custom filter. In this case, the filter pattern can be tailored to exclude either a single IP or a range of them. For example:

  • Exclude the IP address 192.168.1.1 with filter 192\.168\.1\.1.
  • Exclude a range of IP addresses – from 192.168.1.1 to 192.168.1.20 – with the filter ^192\.168\.1\.([1-9]|1[0-9]|20)$

Here’s how you might go about excluding IPs ranging from 192.168.1.1 to 192.168.1.20:

Exclude range of internal IPs

2. Remove referral spam

Ah, spam – the bane of our online existence! Unfortunately, spam is no less forgiving when it comes to analytics and can put a serious dent in the integrity of your referral data.

We ran a sample report in Google Analytics to find the top 10 referrals to clickseed.com in the past year. You may be surprised to know that three of these are known spam sites like Semalt:

semalt.semalt.com
buttons-for-website.com
best-seo-offer.com

Make no mistake – these spam referrals can add up. So what can you do?

If you can pinpoint the culprits here (and note the patterns above: each spam referrer has a 100% bounce rate and exactly 1.00 page per session), you can exclude them with a custom filter. Simply exclude by referral and enter each domain in the field. Quick RegEx recap: remember to use “\” to treat any dots to characters, and “|” (the “or” match) to string several domains together.

Exclude spam referrals

In this example, we’re telling Google Analytics “exclude any referral that matches semalt.com or buttons-for-website.com or best-seo-offer.com.

If you want to fix the problem at the source, you can also prevent spam referrers from ever reaching your site in the first place. If you’re on an Apache server, you can work with your technical team to block spam via your .htaccess file. And if you’re on WordPress, the SpamReferrerBlock plugin can also handle the heavy lifting for you (thanks to Megalytic for the referral).

3. Display hostname and full URL

By default, Google Analytics won’t display the full URL of pages in its reports. So if your site is www.example.com, you’ll see data for your contact page listed as “/contact” in any page-level reports (rather than www.example.com/contact). This may be fine if all of your content lives on your root domain, but if you utilize one or more subdomains like many folks do (e.g., blog.example.com, although we recommend hosting a blog on your root domain) this can cause some confusion as to which pages live where.

Page URL confusion

It’s an inconvenience too. If you try to open these links from a page-level report in Google Analytics (you know, the little grey icon that opens the page in a new window), they’ll point to the root domain. This means any pages on a subdomain will error out when you try and launch them – a pain for sure.

Avoid the confusion and implement this handy filter, which rewrites all URLs to include the full domain:

Display full URL

As this one is a bit more complex, here’s a text-only version:

Filter Type: Custom filter > Advanced
Field A: Hostname
Extract A: (.*)
Field B: Request URI
Extract B: (.*)
Output To: Request URI
Constructor: $A1$B1

Google makes the salient point that if you have any goals configured in Google Analytics, be sure they match up to any URL rewrite filters you’ve implemented.

4. Isolate traffic to a subdomain

Speaking of subdomains, wouldn’t it be useful to simply isolate that traffic to a separate view in Google Analytics? Enter the subdomain filter!

Let’s take our earlier example of blog.example.com. Create a new view and use a predefined filter to include only traffic to that subdomain (no RegEx needed):

Traffic to blog subdomain

A couple notes here:

  • Be sure your subdomain is using the same “UA” tracking property as your main site. This won’t work if you’re treating them as separate properties.
  • Also, it’s a good idea to add your subdomain to the Referral Exclusion List for your main site property so that self-referrals aren’t throwing off your data and logging double sessions. If you’ve already set this up from your main domain (i.e., you’re excluding “example.com”) you should be in good shape here. We understand Universal Analytics now does this automatically.

Tracking a Separate Mobile Site

You can also use this method to setup Google Analytics for a separate mobile site. Under the existing property, setup a new View for your mobile site (e.g., m.example.com) and apply the following filter to isolate the traffic to that hostname only.

Mobile traffic filter

 

5. Lowercase all URLs

Consistency is key in analytics – without it, it can be difficult to make informed decisions based on what the data is telling you. One example is with mixed case URLs. If the URLs on your website are not case sensitive (more on that later), users may be hitting two versions of the same page. Google Analytics is case sensitive, so they’ll be logged separately, like so:

http://www.example.com/contact-us
http://www.example.com/Contact-Us

To consolidate the data, implement a custom filter that will lowercase all URIs:

Lowercase URLs

While this lowercase filter will help unify your page-level data in Google Analytics, it may be merely a Band-Aid on a larger problem. If people can access the same content on your website using mixed case URLs, Google may consider them to be two distinct pages. This is a duplicate content issue that needs to be addressed at the source. Work with your technical team to update your .htaccess file and implement proper canonicalization. Otherwise, you’re splitting the vote as far as SEO goes.

So those are our five handy Google Analytics filters. Implement one or more of these today and see if you won’t be on your way to a more streamlined data-pulling, report-building experience.

What are some of your favorite Google Analytics filters? Let us know in the comments or tweet us @clickseed.

 






Author: Kyle Sutton

Kyle is an SEO Strategist at ClickSeed, an Enterprise SEO & Digital Marketing agency based in Frederick, Maryland.

More Posts »


Follow me on FacebookFollow me on Google+Follow me on TwitterFollow me on LinkedInFollow me on RSS

Leave a Reply

  • (will not be published)