Google analytics

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
Small World Books
New Member
New Member
Posts: 2
Joined: Tue Apr 01, 2008 1:57 am

Google analytics

Post 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!!
alby

Re: Google analytics

Post 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
Last edited by alby on Tue Apr 01, 2008 7:18 am, edited 1 time in total.
Small World Books
New Member
New Member
Posts: 2
Joined: Tue Apr 01, 2008 1:57 am

Re: Google analytics

Post by Small World Books »

Wow - thank you SOO much - it's so easy when you know how! I really appreciate your help, thanks again!!
:)
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Google analytics

Post 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.
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.
pontikka

Re: Google analytics

Post 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
Ziggywigged
Power Poster
Power Poster
Posts: 424
Joined: Sat Feb 02, 2008 12:42 am

Re: Google analytics

Post 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.
Take a penny, leave a penny.
User avatar
voghen
New Member
New Member
Posts: 3
Joined: Wed Jan 07, 2009 12:07 pm

Re: Google analytics

Post 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
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Google analytics

Post 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...
Locked

Return to “[locked] Installation, Setup and Upgrade”