[Solved] Google Analytics Tracking Code breaks template

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
geediu
Forum Members
Forum Members
Posts: 17
Joined: Thu Jan 17, 2008 7:57 pm

[Solved] Google Analytics Tracking Code breaks template

Post by geediu »

Hi,

Not sure if anyone is aware of this... and I dunno when this started happening but Google Analytics has changed their new tracking code to look like this:


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("UA-xxxxxxx-x");
pageTracker._trackPageview();
} catch(err) {}

Notice the { } brackets used in the script. When you place this tracking code into your template, it breaks your template because CMSMS complains. I encountered this problem for a friend of mine and I solved it by taking my own tracking code and letting him use it. He replaced my Web Property ID (UA-xxxxxxx-x) with his own of course, and all is well.

Comments?
Last edited by geediu on Tue Dec 16, 2008 12:35 am, edited 1 time in total.
User avatar
Augustas
Forum Members
Forum Members
Posts: 241
Joined: Wed Oct 17, 2007 6:09 pm

Re: Google Analytics Tracking Code breaks template

Post by Augustas »

wrap your code with
{literal}
{/literal}
http://FollowTheRoad.com/ - living on the road...
http://www.kligys.com/ - asmeninis blog'as...
geediu
Forum Members
Forum Members
Posts: 17
Joined: Thu Jan 17, 2008 7:57 pm

Re: Google Analytics Tracking Code breaks template

Post by geediu »

thanks Augustas that was quick - sorry for posting this obviously newbie question
Post Reply

Return to “CMSMS Core”