1

I'm trying to keep GA from setting cookies on static files like images. All the files concerned are loaded from cookie-free subdomains. Is there a way to exclude these subdomains from getting the cookie that is set by Google Analytics?

  • Is there a tracking code on some of the pages on these subdomains, or are you just finding cookies there? – Stephen Ostermiller Aug 25 '18 at 13:46
  • @StephenOstermiller they're not pages, just images, css files and the like. GA is still sending cookies to them though. – toomanyairmiles Aug 25 '18 at 14:02
  • What is your cookie domain set to in your GA snippet? – Stephen Ostermiller Aug 25 '18 at 17:44
  • @StephenOstermiller auto, which AFAIK should default to the top domain and ignore the subdomains. – toomanyairmiles Aug 25 '18 at 18:33
  • Any cookies set at the top domain will show up on subdomains. I assume that your site is on www? If so you need to set the domain in your ga snippet to include the www. – Stephen Ostermiller Aug 25 '18 at 19:00