News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

How to add google analytics to SMF?

Started by 168forums, December 10, 2008, 02:40:28 PM

Previous topic - Next topic

168forums

Whenever I try to add the code into index.template.php right before the </body>,
the forum down immediately.

And I go back to default theme and delete the code, the forum come back.

Anyone knows how to install the analytics to SMF correctly?

Thanks,


stingerman

Just put it in my footer like stated, no problems so far  :D

sense

put it before the </body> in index.template file.

you need to add an escape character \ before the ' in the Google Analytics code.

otherwise it will give an error.

Granular

I replied to a similar post here : http://www.simplemachines.org/community/index.php?topic=271694.msg1834585#msg1834585

Basically I installed the Global Header & Footer mod - http://custom.simplemachines.org/mods/index.php?mod=351 -  and copied in the Google Analytics code there (in the footer section), seems to work ok.

G

JimM

@168forums - Is this issue solved or do you still require assistance?
Jim "JimM" Moore
Former Support Specialist

crossfire1

Quote from: sense on December 14, 2008, 07:32:55 PM
put it before the </body> in index.template file.

you need to add an escape character \ before the ' in the Google Analytics code.

otherwise it will give an error.

This is great info, thanks a lot.

I would just like to add for all those who don't understand programing that you have to add \ before every ' sign in google script code.

JimM

As the OP has abandoned this topic I have locked it.  If you have a similar issue, please start a new topic.
Jim "JimM" Moore
Former Support Specialist

Advertisement: