I want my own visits not to appear in Google Analytics, and for this I added a test html page on my website. The idea is that I would hit this page once, and GA would not have to count on any of my visits in analytics (by setting opt_scope to _setCustomVar to “visitor”). Below is a snippet of my test html code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'xyz']);
_gaq.push(['_setCustomVar', 'myvisits', 'myvisits', 1]);
_gaq.push(['_trackPageview']);
(function () {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
And now, in my Analytics, I set the following settings:
Filter Name: Myvisits
Filter Type: Custom filter
Exclude
Filter Field: User Defined
Filter pattern: myvisits
Case sensitive: No
Is there any way to check if my customvar passed in GA. I tried to examine the query parameters for __utm.gif anf I could not see the variable myvisits passed. Here are the request details
http://www.google-analytics.com/__utm.gif?utmwv=4.8.9&utmn=485610273&utmhn=www.example.com&utmcs=ISO-8859-1&utmsr=1173x733&utmsc=24-bit&utmul=en-us&utmje=0&utmfl=10.1%20r85&utmhid=2133980375&utmr=-&utmp=%2Fplain.htm&utmac=xyz&utmcc=__utma%3D14266660.362063006.1299003679.1299003679.1299003679.1%3B%2B__utmz%3D14266660.1299003679.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none)%3B&utmu=q
Am I doing something wrong?
source
share