Adding web statistic tool to website code

rpk - June 11, 2009 - 16:23

Hi,

I'm working on a site and need to add the code for a commercial web statistics tool (like Google Analytics). The code is supposed to go right before the closing body tag. I tried adding the code to page.tpl.php in my theme but somehow that didn't work.

I'd be glad for any advice with this!

Thanks
RPK

Well that should work

Steve Hanson - June 11, 2009 - 16:56

But why not just use the excellent Google Analytics module instead?

Steve Hanson
Principal Consultant Cruiskeen Consulting LLC
http://www.cruiskeenconsulting.com

I need to implement a

rpk - June 11, 2009 - 17:14

I need to implement a different statistics tool.

RPK

>I tried adding the code to

mcsolas - June 11, 2009 - 17:24

>I tried adding the code to page.tpl.php in my theme but somehow that didn't work.

Did you clear the site cache?

What happened to the output source code: does it disappear completely or become modified ( ie filtered ) in some way?

---------------------------
www.crsurfcam.com

Oh, the site cache - That was

rpk - June 11, 2009 - 17:58

Oh, the site cache - That was it!

Great, thanks for your help!

RPK

You might use Block

manop - June 11, 2009 - 18:02

You might consider adding your statistics codes to a block as an alternative instead of adding directly to the template file . Then place the block into the footing area.

I use this approach, so the code will not be overwritten when I upgrade/update a theme.

Don't forget to use FULL HTML instead of FILTERED HTML too.

That's an interesting

rpk - June 11, 2009 - 19:17

That's an interesting approach I hadn't considered! Thanks for the advice!

RPK

>I use this approach, so the

mcsolas - June 11, 2009 - 19:44

>I use this approach, so the code will not be overwritten when I upgrade/update a theme.

This makes sense.. I did this once with some analytics code. I upgraded the template and still haven't put it back...

---------------------------
www.crsurfcam.com

 
 

Drupal is a registered trademark of Dries Buytaert.