Google analytics
-
- New Member
- Posts: 2
- Joined: Tue Apr 01, 2008 1:57 am
Google analytics
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
Add your code in all (used) templates of Layout > TemplatesSmall 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!!
Pages use that templates
TIP: surround your javascript code with {literal} {/literal} tag
Alby
Last edited by alby on Tue Apr 01, 2008 7:18 am, edited 1 time in total.
-
- New Member
- Posts: 2
- Joined: Tue Apr 01, 2008 1:57 am
Re: Google analytics
Wow - thank you SOO much - it's so easy when you know how! I really appreciate your help, thanks again!!


-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: Google analytics
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.
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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Google analytics
Could someone please explain me in detail how to:
Pontikka
- add javascript in to global content block
- call that global content block from the 'global metadata' field in the site preferences
Pontikka
-
- Power Poster
- Posts: 424
- Joined: Sat Feb 02, 2008 12:42 am
Re: Google analytics
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.
Take a penny, leave a penny.
Re: Google analytics
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
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
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...