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 have the naked domain address be the same site as the www-prefixed one, but the analytics documentation doesn't state it explicitly.

13.10.2009 16:52:56
2 ОТВЕТА
РЕШЕНИЕ

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.

4
14.10.2009 08:19:14
Nice reply. It's important that you also mentioned the user permanently redirect (ie. HTTP Status 302 - Permanent Redirection) is very important. Search Engines don't like indexing the same site more than once (when url's a different, but point to the same site).
Pure.Krome 14.10.2009 08:02:24
@Pure.Krome: to be precise, HTTP 301 is the status code for permanent redirection.
viam0Zah 14.10.2009 08:14:10
This is completely false: www.domain.tld and domain.tld are treaded just the same, and get the same value for the HASH code (the number at the start of each __utm cookie). This an exception: every other subdomain.domain.tld will be handeld as a distinct web site
Open SEO 20.03.2012 21:14:10

Yes, that has been my experience.

1
13.10.2009 16:53:50
Thank you, that was exactly the answer I was looking for.
Björn Lindqvist 13.10.2009 17:29:57