: SetLocalServerMode in Google Analytics still tracks visits I run a website where I am including an older script version of Google Analytics. I really only need it to create the necessary cookies,
I run a website where I am including an older script version of Google Analytics. I really only need it to create the necessary cookies, not for tracking, so I set it to Local Server Mode. Link here.
This here is the script:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXXX-X']);
_gaq.push('_setLocalGifPath','http://www.site.tld/sites/all/themes/site/images/1px.gif');
_gaq.push('_setLocalServerMode');
_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);
})();
</script>
LocalServerMode should prevent Google Analytics from tracking visits to my website. It's not working though; visits are still being registered. Fiddler also shows that the local 1px.gif is never requested. Mostly setLocalServerMode does not appear to do anything.
More posts by @Yeniel560
1 Comments
Sorted by latest first Latest Oldest Best
The lines you've added to the javascript are missing square brackets (compare your code to the documentation you linked to). It should be:
_gaq.push(['_setAccount', 'UA-XXXXXXXX-X']);
_gaq.push(['_setLocalGifPath','http://www.site.tld/sites/all/themes/site/images/1px.gif']);
_gaq.push(['_setLocalServerMode']);
_gaq.push(['_trackPageview']);
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.