Take the 2-minute tour ×

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.

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

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.

share|improve this answer
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 Oct 14 '09 at 8:02
@Pure.Krome: to be precise, HTTP 301 is the status code for permanent redirection. –  Török Gábor Oct 14 '09 at 8:14
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 Mar 20 '12 at 21:14
add comment

Yes, that has been my experience.

share|improve this answer
Thank you, that was exactly the answer I was looking for. –  Björn Lindqvist Oct 13 '09 at 17:29
add comment

Your Answer


