If you are like me, you are probably one of the most frequent visitors to your own site. And if you are using Google Analytics this can present a number of problems when it comes to accurate reporting. This tutorial explains the best and easiest way to filter your own computer from Analytics reporting.
This is a two pronged approach that uses a combination of scripting to place a cookie on your computer and a custom filter in Google Analytics.
STEP 1 – Cookie
The first thing that you need to do is create an HTML file that places the required cookie information on your computer. To do this you will need to create a blank HTML file. If you are not familiar with HTML, simply open a new text file in Windows (not a Word Pad file, rather a Note Pad file). Now save this file as filterGA.html and keep it open for editing.
You will need to place the following into the file and save it when finished:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Filter GA</title>
</head>
<body onLoad=”javascript:pageTracker._setVar(‘test_value’);”>
<script type=”text/javascript”>
var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
document.write(unescape(“%3Cscript src=’” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));
</script>
<script type=”text/javascript”>
var pageTracker = _gat._getTracker(“UA-927027-2″);
pageTracker._trackPageview();
</script>
</body>
</html>
Now upload this file (filterGA.html) to your web server. Place it anywhere you want as long as the file can be accessed from a web browser.
Next, visit the page that you just uploaded using your browser. You should see a blank white page. I recommend bookmarking this page so that you can re-visit the page anytime you are working on a new computer or after you clear your cookies and cache from your machine.
STEP 2 – Filter
Now, you will need to set up a filter in Google Analytics. Log into your Analytics account and navigate to the Filter Manager, then click the link to add a new filter.
In the first field add a name for the filter for identification.
In the second field, from the drop-down select “Custom Filter.” This will open additional fields. Select the radio button next to the top choice, “Exclude.”
From the drop-down menu called “Filter Field” select the option “User Defined.”
In the “Filter Pattern” field, type “test_value” and choose “no” for case sensitive.
Select the websites that you wish to apply the filter too (most likely all of the sites being tracked in your Analytics account), and save your changes.
Finished! You are now being filtered out of your analytics reporting from this moment onward. Just remember to re-visit the filterGA.html page from each computer that you use to view your traffic stats. Also be sure to revisit the cookie page if you delete cookies or clear your old browsing data to ensure that the cookie remains in place.
There are many ways to filter yourself out of Google Analytics, but this method is my preferred option. In this way I have more control over when and from where I am filtered.















