[SOLVED] Google Analytics code causes error in CMS site

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
miles
Forum Members
Forum Members
Posts: 28
Joined: Wed May 07, 2008 9:20 am

[SOLVED] Google Analytics code causes error in CMS site

Post 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?
Last edited by miles on Sun May 19, 2013 2:11 pm, edited 1 time in total.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Google Analytics code causes error in CMS site

Post by Rolf »

Use a space before and after each { and }

Rolf
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
miles
Forum Members
Forum Members
Posts: 28
Joined: Wed May 07, 2008 9:20 am

Re: Google Analytics code causes error in CMS site

Post 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!
miles
Forum Members
Forum Members
Posts: 28
Joined: Wed May 07, 2008 9:20 am

Re: Google Analytics code causes error in CMS site

Post by miles »

Rolf wrote:Use a space before and after each { and }

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

Return to “CMSMS Core”