谷歌分析是否将裸域与www子域结合? [英] Does google analytics combine naked domains with the www subdomain?

查看:86
本文介绍了谷歌分析是否将裸域与www子域结合?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为自己的域名安装了google analytics, http://mydomain.com 。输入 http://www.mydomain.com 的用户是否也会被分析脚本计算在内? 对我来说,它似乎是合乎逻辑的,因为裸体域名地址与www前缀地址相同是常见的,但分析文档没有明确说明。

解决方案

是的,用户将被跟踪,但来自 www.datalookups.com datalookups.com 将被视为两个不同的访问者。 GA使用cookies来存储访问者的会话信息,由于 www.datalookups.com datalookups.com 是不同的主机,因此不同的Cookie属于它们。为了解决这个问题,我建议设置一个正确的HTTP重定向,从而使用户从 www.datalookups.com 永久地访问 datalookups.com ,反之亦然 - 这是一个问题的味道。 (更不用说,这种方法使搜索引擎抓取工具拖垮了两次索引您的网站内容。)



为了完整起见,有一种方法可以告诉Google Analytics分享使用 pageTracker._setDomainName 函数,但这不是当前情况的正确答案。


I have google analytics installed for my own domain, http://mydomain.com. Will a user that enters http://www.mydomain.com be counted by the analytics script too?

To me it seems logical that it would, since it is so common to have the naked domain address be the same site as the www-prefixed one, but the analytics documentation doesn't state it explicitly.

解决方案

Yes, users will be tracked, but the same visitor coming from www.datalookups.com and datalookups.com will be counted as two different visitors. GA uses cookies to store session information on visitors, and since www.datalookups.com and datalookups.com are different hosts, different cookies belong to them. To get over this issue, I suggest to set up a proper HTTP redirection that brings permanently either user from www.datalookups.com to datalookups.com or vice versa—it's a matter of taste. (Not to mention that this method balks search engine crawlers to index your web content twice.)

For the sake of completeness, there is a way to tell Google Analytics to share session information between to different hosts with the pageTracker._setDomainName function, but that is not the right answer for the current situation.

这篇关于谷歌分析是否将裸域与www子域结合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆