Does Google Analytics bundle bare domains with the www subdomain?

I have a Google Analytics, set for my own domain http://mydomain.com

. Will the invoice that goes into http://www.mydomain.com

using the analytics script?

It seems logical to me that this would be the case, because it is so common that the bare domain address was the same site as www-prefixed, but the analytics documentation does not explicitly state it.

+2


source to share


2 answers


Yes, users will be tracked, but the same visitor visiting www.datalookups.com and datalookups.com will count as two different visitors. GA uses cookies to store session information for visitors, and since www.datalookups.com and datalookups.com are different hosts, they have different cookies. To solve this problem, I suggest setting up a proper HTTP redirect that constantly takes the user from www.datalookups.com to datalookups.com or vice versa - it's a matter of taste. (Not to mention, this method prevents crawlers from indexing your web content twice.)



For completeness, Google Analytics allows you to report session information between different hosts using a pageTracker._setDomainName

function, but this is not the correct answer for the current situation.

+4


source


Yes, that was my experience.



+1


source







All Articles