Multiple Google Analytics Codes on 1 Website

Often you have a situation in website analysis where you need to be able to track visitors on a subdomain but also track how they traverse across he entire website.

One solution is to use a modified Google Analytics code to track visits across the subdomain.  This inserts the below line into the GATC.  Notice the “.” before YOURSITE.  This allows each subdomain to write to the tracking cookie and allows visitor information to travel across with the visit.

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

The other way to do this is to have multiple Google Analytics codes on the 1 website, and is often called roll up reporting.  It is quite simple, all you need to do is add the tracking parameters for the second GA account with a slightly modified name.. i.e. “b.”

_gaq.push(['b._setAccount', UA-636842-12]);


The second method is best when you have one parent site that wants a macro view of the overall performance of the website, but still want the smaller business units to have control over their own subdomain.

If you have any tricky Google Analytics questions please feel free to reply and I’ll give you some feedback, Google Analytics is highly customisable and answers can be found to almost every problem.

One Response to “Multiple Google Analytics Codes on 1 Website”

  1. dich vu seo nói:

    Bài viết thật hữu ích cho những newbies như mình, cảm ơn bạn

Leave a Reply