I’m trying to set up an exclusion filter with a browser cookie, so that my own visits to my don’t show up in my Google Analytics. I tried 3 different methods and none of them have worked so far. I would like help understanding what I am doing wrong and how I can fix this.
First, I tried following Google’s instructions, http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55481, for excluding traffic by Cookie Content:
Create a new page on your domain,
containing the following code:
Next, when that didn’t work, I googled around and found this Google thread, http://www.google.com/support/forum/p/Google%20Analytics/thread?tid=4741f1499823fcd5&hl=en, where the most popular answer says to use a slightly different code:
SHS Analytics wrote:
Thank you! This has now set a __utmv cookie containing “test_value”,
whereas the original:
(which Google is still recommending)
did not manage to do that for me (in
Mac Safari 5 and Firefox 3.6.8).
So I tried this code, but it didn’t work for me.
Finally, I searched StackOverflow and came across this thread, https://stackoverflow.com/questions/3495270/exclude-my-traffic-from-google-analytics-using-cookie-with-subdomain, which suggests that the following code might work:
var _gaq = _gaq || ();
This script appeared in the head element in the example, instead of in the onload event of the body like in the previous 2 examples. So I tried this too, but still had no luck with trying to exclude myself from Google Analytics.
So, I tried all 3 methods above with no success. Am I doing something wrong? How can I exclude myself from my Google Analytics using an exclusion cookie for my browser?
I’ve been testing this for several days now, and I’ve confirmed that the 2nd method of excluding yourself from tracking does indeed work. The problem was that the filter settings weren’t properly applied to my profile, which has been corrected. See the accepted answer below.