Google Analytics cookies vs subdomain for static content

后端 未结 3 1876
礼貌的吻别
礼貌的吻别 2021-01-02 05:10

I have a website on www.example.com and use Google Analytics. I\'ve also set up static.example.com which serves all static content.

The problem is that the default b

3条回答
  •  半阙折子戏
    2021-01-02 05:45

    The solution is to do pageTracker._setDomainName("www.example.com") and then GA will issue the cookies to ".www.example.com". That way analytics still works fine and the cookies do not leak into the other static subdomain.

提交回复
热议问题