开发者

Does google analytics combine naked domains with the www subdomain?

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 开发者_C百科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.


Yes, that has been my experience.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜