Page 1 of 1

Google Analytics

Posted: Mon Nov 24, 2008 5:15 pm
by tuneden
I'm having trouble getting the default Google Analytics code installed properly on my CMSMS install.  When the following is included in either the template, as a global content block, or as a part of each individual page, SMARTY has difficulty with it.


var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));


try {
var pageTracker = _gat._getTracker("my-account-here");
pageTracker._trackPageview();
} catch(err) {}

Please note: I've intentionally left out my urchin ID from the above block.

Anybody know how to set up a CMSMS for Google Analytics?

Re: Google Analytics

Posted: Mon Nov 24, 2008 6:15 pm
by cb2004
Put {literal} before the script tag and then {/literal} at the end of the code.

Re: Google Analytics

Posted: Mon Nov 24, 2008 7:07 pm
by hexdj
This has been discussed before, do a search before you post, it saves everyone time.

Re: Google Analytics

Posted: Mon Nov 24, 2008 8:46 pm
by tuneden
Thanks for the answers and prompt response.  Ya know, I'd done what I thought was a thorough search for posts on the subject but was unable to find anything. Can you show me where the previous responses are?

Again, many thanks!

Re: Google Analytics

Posted: Tue Nov 25, 2008 8:27 am
by Zoorlat
Tuneden,
Here is your answer: http://forum.cmsmadesimple.org/index.php?topic=27487.msg133232

Next time you might want to search using google. In this case, a simple search for "Google Analytics site:forum.cmsmadesimple.org" (http://www.google.com/search?q=Google+Analytics+site%3Aforum.cmsmadesimple.org) would have given you what you are looking for.

Happy CMSMS-ing!
/Z