Page 1 of 1

[SOLVED] Google Analytics code causes error in CMS site

Posted: Sun May 19, 2013 1:34 pm
by miles
I have a couple of new CMS sites (V 1.11.6) i am trying to track using Google Analytics but when i put the tracking text into the General Settings / Global Metadata i get the following error on my web site:
Error: at line 702 in file D:\WEBSITES\PCSMANAGED\GOOGLE RANKINGS\asbestos-survey-london.co.uk\lib\smarty\sysplugins\smarty_internal_templatecompilerbase.php:

Message:
Syntax Error in template "f75132494758a6d183ec79992042d6b1a6f033d0" on line 9 "(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){" - Unexpected "[", expected one of: "}" , " " , ATTR
If i use google analytics code from a previous analytics account (generated 4 or 5 weeks ago) it works OK...

the analytics code is different in that at the begining the older version says <__script__ type="text/javascript">
the new version just says <__script__> and the code just looks completely different...

has anyone else had this issue?

Re: Google Analytics code causes error in CMS site

Posted: Sun May 19, 2013 1:53 pm
by Rolf
Use a space before and after each { and }

Rolf

Re: Google Analytics code causes error in CMS site

Posted: Sun May 19, 2013 2:00 pm
by miles
Just fiddling with this now and i have found that when creating a Google account for the new site it offers me either 'Classic' or 'Universal (Beta)' so if i get Classic i get <__script__ type="text/javascript"> in the code and it works but if i get the Beta Universal code it causes the issue. i will give the space before & after a go on the new code and see what happens!

Re: Google Analytics code causes error in CMS site

Posted: Sun May 19, 2013 2:10 pm
by miles
Rolf wrote:Use a space before and after each { and }

Rolf
Your a genius! thanks very much this is now Solved!