问题
I'm testing Google Analytics Event tracking with my local server.
I'm using the debug version of ga.js, ga_debug.js, in order to print debug text automatically in my browser console. Furthermore, i set domain name to none, which is supposed not sending the data to your Analytics account (stackoverflow post):
_gaq.push(['_setAccount', 'UA-XXXXXXX-X']);
_gaq.push(['_setDomainName', 'none']);
...
But my events tracked are still sent to my Analytics Account, so my question is how to avoid this?
Is the _gaq.push(['_setDomainName', 'none']);
disable data sending only for page view and not event tracking?
Thanks for your help,
Xavier
回答1:
Add the following snippet to your dev environment:
window['ga-disable-UA-XXXXXX-Y'] = true;
For more information read https://developers.google.com/analytics/devguides/collection/gajs/#disable
来源:https://stackoverflow.com/questions/17165594/google-analytics-event-tracking-how-to-avoid-sending-data-for-local-test