google analytics – for all subdomains

To be able to track all subdomains via one google analytics (f.e. if you have web page on and blog on you have to adjust GA code.

To achieve this, i’ve copied Ga.php Block to:


added this function:
protected function _getSubdomainCode()
return "_gaq.push(['_setDomainName', '']);\n";

and finally added extra code to protected function _toHtml()

you can download the final code here: Ga.php

Leave a Reply