Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: 168forums on December 10, 2008, 02:40:28 PM

Title: How to add google analytics to SMF?
Post by: 168forums on December 10, 2008, 02:40:28 PM
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,
Title: Re: How to add google analytics to SMF?
Post by: stingerman on December 14, 2008, 06:05:47 PM
I am wondering the same.  Found this -

http://www.simplemachines.org/community/index.php?topic=272690.0 (http://www.simplemachines.org/community/index.php?topic=272690.0)
Title: Re: How to add google analytics to SMF?
Post by: stingerman on December 14, 2008, 06:07:13 PM
Just put it in my footer like stated, no problems so far  :D
Title: Re: How to add google analytics to SMF?
Post by: 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.
Title: Re: How to add google analytics to SMF?
Post by: Granular on December 15, 2008, 08:26:25 AM
I replied to a similar post here : http://www.simplemachines.org/community/index.php?topic=271694.msg1834585#msg1834585 (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
Title: Re: How to add google analytics to SMF?
Post by: JimM on January 08, 2009, 12:12:23 AM
@168forums - Is this issue solved or do you still require assistance?
Title: Re: How to add google analytics to SMF?
Post by: crossfire1 on May 18, 2009, 12:34:41 PM
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.
Title: Re: How to add google analytics to SMF?
Post by: JimM on May 18, 2009, 10:59:56 PM
As the OP has abandoned this topic I have locked it.  If you have a similar issue, please start a new topic.