Using Google Analytics with my Web Pages / Java Script application I just wonder what happens to the statistics when I run (test) the pages locally? Testing the application is done on a local web server, is this included in the statistcis?
Or, in turn, is this the keyline
_gaq.push(['_setDomainName', 'mydomain.org']);
and all “recording” is restricted to mydomain.org? Any idea how this works?
If you set your
setDomainNamefor a domain that doesn’t match the current domain, it will not work.So, if its set to
mydomain.org, and you’re ontesting-domain.org, Google Analytics will try to set the cookies tomydomain.organd fail (because the cookies won’t be set, as you can’t set external domain cookies from JavaScript); seeing no cookies, it will not make the__utm.gifrequest go Google Analytics, and no data will be tracked.The same thing will occur if you execute Google Analytics on the
file://protocol.(The exception to the
setDomainNamerule is if you pass either a non-domain string like(none)or an empty string tosetDomainName, which has the effect of setting the domain hash (a cookie identifier to prevent data collision) to1and setting the Google Analytics cookies to the domain ofdocument.domain