I am using Google Analytics on an ajax heavy website. I have a timer on the website, making an XMLHttpRequest every few seconds. With every request, browser sends the Google Analytics cookies to my server. Since my server don’t use these cookies, I want to somehow prevent the browser to include these cookies in every request.
including _gaq.push([‘_setDomainName’, ‘none’]); did not help!
any ideas ?
Google Analytics cookies are first party cookies.
They will be sent as every other first party cookie for each request to the same domain (and subdomains)
You need to use a different domain for your Ajax calls (but I guess it would bring some other troubles, but solutions exist : Cross Domain request )
Using a path like
www.domain.com/ajax/under which all ajax calls would happen, and create empty __utma, __utmb, __utmc and __utmz cookies with a cookie path of/ajax/would fail.The empy cookies will not supersede the domain cookie for these requests , but will be added first in the request order