Mobile app version of vmapp.org
Login or Join
Sims2060225

: How to make google analytics report on two domains as though they are one site? We have a main site that Google analytics is currently running fine on (www.ourcompany.com). We have a page

@Sims2060225

Posted in: #Domains #Google #GoogleAnalytics

We have a main site that Google analytics is currently running fine on (www.ourcompany.com). We have a page that is technically part of the site (same design, etc.) but is hosted on another server/domain for various business reasons (www.ourparentcompany.com/ourcompanyapp/).

Do we just add the normal google analytics code to the bottom of that page? Or is there something more we have to do?

If there isn't anything more then couldn't anyone just take your GA code and start reporting analytics to your profile from their site?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Sims2060225

1 Comments

Sorted by latest first Latest Oldest Best

 

@XinRu657

You need to either set the domain name to 'none' OR remove the domain hash otherwise visits from one of the sites won't get tracked:

Either:

_gaq.push(['_setDomainName', 'none']);


Or:

_gaq.push(['_setAllowHash', false]);


You should use the first operation when you are tracking across domains but not across sub-domains. If you need to track across sub-domains as well then you should use the second approach.

You also might want to use the linker so that the GA cookies are transferred across to the other domain when a user moves onto it from a link in the other site:

_gaq.push(['__setAllowLinker', true]);


However, the cookies won't be available from one domain on the other if the user enters from a source other than one of your sites. This is because GA uses first party cookies.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme