How to install Google Analytics on a site with sub domains or 301 redirects

domain redirected to directory of other domain

If the domain you enter into Google Analytics is different than where the Joomla site actually resides, you may need to alter the Google Analytics code to make it work.



Say you have a domain www.mysite.com and a points to, is re-directed to another site or sub domain, all you need to do is add one line of code to the Google Analytics code which you put in your Joomla site.

Just add: pageTracker._setDomainName("none");

after the line: var pageTracker = _gat._getTracker("UA-12345-1");

This tell Google Analytics that the actually site may not be on that domain and don't worry its safe, it comes from Google Analytics themselves.

More information about this can be found from Google Analytics help.


Trackback(0)
Comments (0)Add Comment

Write comment

security code
Write the displayed characters


busy



More help and how to articles:


Copyright ©2007-2011 youtukan.com all Rights Reserved.  Privacy policy. Rat, wissen und selbsthilfe.