Using Google Analytics to exclude traffic
23 Dec
There are many ways to track or not track information on your website. Recently I wrote about tracking mobile visitors that come to your website and how you could go about doing this. There are just so many ways to track what people are doing, how they are doing it and when they do it when you are working with web analytics in your daily online business operations. The possibilities are endless when it comes to web analytics.
When you are talking about web analytics you are talking about collecting data about your website “accurately”. This brings me to the topic of excluding website traffic like the website traffic that you generate when updating your website and testing it. Naturally this does present a problem because most people visit their own website when they make changes to it or if they are updating it. By default, web analytics platforms will track website traffic regardless of who you are and you have to tell the web analytics software to exclude your traffic from the web analytics reports.
There are a few standard ways to exclude traffic from your web analytics platform. You can exclude traffic by an IP Address or a range of IP addresses or by creating a custom cookie that can block your traffic. I personally prefer using the custom cookie when I am working with the Google Analytics platform because I am only trying to exclude my specific traffic but if I ran a company with more than one employee I would be sure to use to exclude traffic based on an IP address or a range of IP addresses. When I get into showing you how you can exclude traffic from your web analytics platform I am using Google Analytics as an example but depending on the web analytics platform there should be a way to exclude traffic using either of these methods. So let’s get started with the Cookie Content Method and then move on to the IP Address Method.
Excluding Traffic from Google Analytics – The Cookie Content Method
Like I said, this is personally the way that I choose to exclude traffic from my web analytics reports. It’s simple and straight forward.
1. Create a new web page and upload it to your website containing this code…
<body onLoad=”javascript:pageTracker._setVar(’my_cookie_content_value’);”>
2. Than simply visit the web page containing the above mentioned code which will create a cookie with Google Analytics (Your web analytics platform may differ so refer to the documentation from your web analytics platform vendor)
3. Create a filter in your Google Analytics account to remove the data associated to users with this cookie. Make sure the filter that you create includes the following…
Filter Type: Custom filter > Exclude
Filter Field: User Defined
Filter Pattern: my_cookie_content_value
Case Sensitive: No
It should look like this…

Excluding Traffic from Google Analytics – The IP Address Method
This method requires you to understand how to use regular expressions
1. Click “Filter Manager” from the “Analytics Settings” page in your Google Analytics account
2. Enter a “Filter Name”
3. Select the “Filter Type” equal to “Exclude all traffic from an IP Address”
4. Enter the “IP Address” field enter the IP address you want to exclude in your web analytics reports. If you are entering an IP address 178.155.2.1 you would need to enter it similar to 178\.155\.2\.1 and if you wanted to exclude a range of IP address like 176.168.1.1-25 and 10.0.0.1-14 it would look like this ^176\.168\.1\.([1-9]|1[0-9]|2[0-5])$|^10\.0\.0\.([1-9]|1[0-4])$. Now this method isn’t for everyone and given your situation it may or may not work for you.
So as you can the IP Address method for excluding traffic requires you to have knowledge of regular expressions because of how you have to enter the IP Addresses into Google Analytics. I am not sure whether other web analytics platforms are different or if they too require you to use regular expressions as well when excluding by IP Address. No matter how you choose to do this or whatever web analytics platform you currently use there is a solution out there that can and will work for you when you exclude your traffic from web analytics reports.
Happy “Accurate” Web Reporting!
Luc Arnold







No comments yet