Page 1 of 1

[SOLVED] Problem w Global Cont Blck- Google analytics/script

Posted: Thu Mar 10, 2011 8:19 pm
by fearmydesign
Hello all, I have done this many times before, not sure why it's not working now. I put the Google Analytics code into a Global Content Block and then call that block right before the </head> on my template, but it's not being recognized by Google, and when I do a View Source, it is missing the (Function({?})

Site: http://www.LimoServicesMaryland.com
CMSMS ver: 1.9.4

I even tried using {literal} inside the Global Content Block for the google code, but nothing!

Any ideas? Thank you

Re: Problem with Global Content Block - Google analytics/scr

Posted: Thu Mar 10, 2011 8:36 pm
by Wishbone
Did you disable WYSIWYG, by turning off 'Use WYSIWYG' not 'Turn WYSIWYG on/off'.. Slight, but important distinction there. You will certainly need {literal}

Re: Problem with Global Content Block - Google analytics/scr

Posted: Thu Mar 10, 2011 8:37 pm
by uniqu3
In GCB's you can deactivate WYSIWYG, please do that and wrap the google code inside {literal} {/literal} and it should work.

Edit: ups Wishbone, posted at same time :-)

Re: Problem with Global Content Block - Google analytics/scr

Posted: Thu Mar 10, 2011 10:36 pm
by fearmydesign
Did you disable WYSIWYG, by turning off 'Use WYSIWYG' not 'Turn WYSIWYG on/off'.. Slight, but important distinction there. You will certainly need {literal}
Yes I did, I always do this (on/off) for scripts/literals... thanks
In GCB's you can deactivate WYSIWYG, please do that and wrap the google code inside {literal} {/literal} and it should work.
..hmmnn... this is weird... I deactivated the GCB like you suggested, added the {literals} and it worked... how? I never had to do this before... but thank you.

...BTW I went back and activated the GCB again, and it's still working... O0

Re: [SOLVED] Problem w Global Cont Blck- Google analytics/sc

Posted: Wed Aug 03, 2011 6:28 pm
by simon.romin
Hi guys

I'm experiencing this exact same problem.

I have put my <head> tag in a GCB called {global_content name='head'} because I have multiple page templates. WYSIWYG is turned off on GCB.

Google Analytics has been reporting 'Tracking Not Installed' for at least 48 hours.

The only thing I can try now is the {literal} tags that I haven't done this yet. Do I put the {literal} tag before or after Google Analytic's <__script__> tags?

Is there anything else you can suggest?

Re: [SOLVED] Problem w Global Cont Blck- Google analytics/sc

Posted: Thu Aug 04, 2011 5:32 pm
by simon.romin
Hey guys,

Just to let you know that my Google Analytics works now.

For anyone else experiencing problems with Google Analytics tracking - especially when their code is in a Global Content Block - try using the {literal} and {/literal} tags immediately before and after the GA code.

Google isn't reporting as many hits to my site as my usual tracking software does, but I will give it a week to see how they compare.

Hope that helps someone along the line.