Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Mod Requests => Aiheen aloitti: AntiRules - helmikuu 21, 2008, 10:47:40 AP

Otsikko: how to track visitors?
Kirjoitti: AntiRules - helmikuu 21, 2008, 10:47:40 AP


http://www.simplemachines.org/community/index.php?topic=223237.0 (http://www.simplemachines.org/community/index.php?topic=223237.0)
Otsikko: Re: how to track visitors?
Kirjoitti: karlbenson - helmikuu 22, 2008, 11:13:13 IP
If you want extended logging like that, you might want to look into Google Analytics.
Otsikko: Re: how to track visitors?
Kirjoitti: AntiRules - helmikuu 23, 2008, 04:56:56 AP
where  i can found it?
Otsikko: Re: how to track visitors?
Kirjoitti: karlbenson - helmikuu 23, 2008, 10:26:11 AP
http://www.google.com/analytics/
Otsikko: Re: how to track visitors?
Kirjoitti: AntiRules - helmikuu 24, 2008, 06:05:20 AP
thanks karlbenson its really gr8 but where i put the code i need to track the topics so where i put the code ?
Otsikko: Re: how to track visitors?
Kirjoitti: Harro - helmikuu 24, 2008, 09:31:33 AP
You have to put that code just before the </body> tag in your index.template.php file of the theme you are using.
Also make sure that you add a \ before every '  in the code you get from google.
Otsikko: Re: how to track visitors?
Kirjoitti: AntiRules - helmikuu 25, 2008, 02:28:16 AP
i didnt understand why i should add \ before the '
Otsikko: Re: how to track visitors?
Kirjoitti: Harro - helmikuu 25, 2008, 03:58:50 IP
If you keep the single quotes you will get parse errors since the single quote is used in the php script to show things.
Something like this will give a parse error
echo ' it's the google code ';
The ' in " it's " will break the echo statement and give the parse error.
To prevent that you have to add the \ before it.
Like this:
echo ' it\'s the google code';
Then you won't get that error. It's just basic php syntax.
Look it up if you don't believe me :P

Google uses the ' quotes in their quote, and SMF uses the echo statement to show things on the screen. So if you don't change the ' to \' you'll get errors.