从分析跟踪中排除子域

发布于 2024-12-23 11:53:48 字数 250 浏览 5 评论 0原文

我在 www.example.com 上有一个网站并使用 Google Analytics。该网站有很多我想使用 Google Analytics 进行跟踪的子域。它还具有一些静态子域,例如 static.example.com,它们提供所有静态内容。

Google Analytics 在所有子域上发布 cookie,但我不希望静态内容流量承载 GA cookie 的重量。

关于如何排除静态子域被 Google Analytics 跟踪的任何想法?

I have a website on www.example.com and use Google Analytics. This website has lots of subdomains which I want to track using Google Analytics. It also has some static subdomains like static.example.com which serve all static content.

Google Analytics is issuing cookies on all subdomains but I don't want the static content traffic to be carrying the weight the GA cookies.

Any ideia on how to exclude the static subdomains from being tracked by Google Analytics?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

祁梦 2024-12-30 11:53:48

您可以使用这行代码

pageTracker._setDomainName("www.example.com")

这将为 www.example.com 发出 cookie,并且 cookie 不会泄漏到静态子域。

You can use this line of code

pageTracker._setDomainName("www.example.com")

This will issue cookies for the www.example.com and the cookies won't be leaked to the static subdomain.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文