Properly configuring IIS and Apache will do an excellent job at keeping your analytics data clean. But if you were put in charge of setting up Google Analytics and your IIS or Apache is a mess, I have 5 filters for you that will clean up your Google Analytics data.
Think of Google Analytics as a court reporter. They’re those people you see in a court room typing away on a strange looking typewriter called a stenotype. Their job is to not miss a single spoken word. Likewise, Google Analytics records everything and is case-sensitive.
Let’s tame this wild animal.
1. Append Hostname
Content reports inside Google Analytics only show the URI (URL minus the domain). Normally, this is not an issue. But what happens when you have a site with multiple subdomains? How would you be able to tell what domain/subdomain a page belongs to?
The filter below will append the hostname to the Request URI field:
2. Lowercase Your URLs
Your Google Analytics data can easily become out of control. If your IIS or Apache server doesn’t automatically lowercase your URLs, you’re setting yourself up for trouble. Here’s an example:
All 4 URLs likely display the same page, but Google Analytics displays them as unique pages. We want to convert all 4 URLs to be lowercase so they only appear as one page. This can be done with a lowercase filter.
The filter below forces the Request URI to be lowercase:
Don’t stop there. Setup a lowercase filter for Hostname, Campaign Name, Campaign Term, Campaign Medium and Campaign source to cover your bases.
3. Remove Local Traffic
Do you want your visits to your site recorded? I didn’t think so. If you are unfortunate enough to have a dynamic IP assigned to you by your ISP, your only decent option is to install one of the many Chrome extensions like Block Yourself from Analytics.
If you have a range of IP’s or a single static IP, you can use a filter to prevent your traffic from being reported. I recommend you use Actual Metric’s IP Range Regular Expression Builder if you are dealing with a range of IP’s.
4. Include Only Traffic to Your Hostname
There is nothing stopping a person from stealing your Property Tracking ID and placing it on their own site. Sometimes this can happen because of an innocent copy and paste. Nevertheless, you don’t want someone else’s data setting up camp in your data.
Only include traffic from your hostname with this filter:
5. Filter Out Bot Traffic
Over the last few years, “smart” bots have popped up in Google Analytics reports and causing havoc with your data. Google Analytics has answered by adding the option to filter out bot and spider traffic with the simple click of a checkbox, labeled: “Exclude traffic from known bots and spiders”.
You will find the option below on your View Settings tab.
That is my list of mandatory Google Analytics filters. If I missed one of your mandatory filters, drop a comment and I’ll add it to the list.