Page 1 of 1

Google analytics

Posted: Tue Apr 01, 2008 2:01 am
by Small World Books
I'm trying to put the Google Analytics code on each page of my website and it says to put it before but the only place I could find that was on the hompage template - anyone know how I go to each page in CMS Made Simple to be able to paste this in each page? It's probably a very easy thing to do, sorry!!

Re: Google analytics

Posted: Tue Apr 01, 2008 7:15 am
by alby
Small World Books wrote: I'm trying to put the Google Analytics code on each page of my website and it says to put it before but the only place I could find that was on the hompage template - anyone know how I go to each page in CMS Made Simple to be able to paste this in each page? It's probably a very easy thing to do, sorry!!
Add your code in all (used) templates of Layout > Templates
Pages use that templates

TIP: surround your javascript code with {literal} {/literal} tag

Alby

Re: Google analytics

Posted: Wed Apr 02, 2008 7:40 am
by Small World Books
Wow - thank you SOO much - it's so easy when you know how! I really appreciate your help, thanks again!!
:)

Re: Google analytics

Posted: Fri Apr 04, 2008 4:03 pm
by calguy1000
another tip would be to place your javascript code in a global content block
and then just call that global content block from the 'global metadata' field in the site preferences.

Then so long as you have
{metadata} in your page templates.... the google analytics code will get inserted.

Re: Google analytics

Posted: Thu May 15, 2008 3:22 pm
by pontikka
Could someone please explain me in detail how to:
  • add javascript in to global content block
  • call that global content block from the 'global metadata' field in the site preferences
Thanks,
Pontikka

Re: Google analytics

Posted: Thu May 15, 2008 4:06 pm
by Ziggywigged
I may be wrong on this but I believe google requires the js be placed right before the closing body tag so alby's recommendation may work best.

Re: Google analytics

Posted: Thu Jan 08, 2009 8:49 am
by voghen
Very nice!
The "literal" code makes it work!!! I tried a thousend times, but only had errors - now it works!
What the heck makes Google-Code literal... ;-)

Greetings

Re: Google analytics

Posted: Thu Jan 08, 2009 6:04 pm
by Dr.CSS
When you put something in your template/page that uses {  } in it and isn't a module/tag call smarty trys to parce it as one so you need the {literal} to make it know it's not that kind of call, this is true no matter where you put it...