Page 1 of 1
Where to put code for stats?
Posted: Wed Sep 03, 2008 11:44 am
by Tom_M
Hello
I'm trying to put code into CMS so I can track visitors. The stats program says that you have to put an include into your index page for it to work. The code you get is: include "/home/user/public_html/cnstats/cnt.php. I've tried putting it at the beginning of the index page but that just creates an error warning at the top of the page. Any help would gratefully appreciated.
Tom
Re: Where to put code for stats?
Posted: Wed Sep 03, 2008 12:00 pm
by junito
What kind of code do you want to add? Google analytics?
Re: Where to put code for stats?
Posted: Wed Sep 03, 2008 3:59 pm
by Tom_M
It's just site statistics analysis software, a bit like Awstats.
Cheers,
Tom
Re: Where to put code for stats?
Posted: Wed Sep 03, 2008 4:07 pm
by Nick Smart
I should think you need it at the bottom of every page, not just your index page, to get meaningful stats. Its better at the bottom so it doesn't slow down your page load times.
You can try this:
1. Create a UDT and copy and paste the code from the include file into your UDT (minus the opening and closing php tags).
2. Put a reference to the UDT at the bottom of all your templates, just above
Nick
Re: Where to put code for stats?
Posted: Wed Sep 03, 2008 4:30 pm
by Tom_M
I'll try that Nick. Thanks for the advice.
Best wishes,
Tom
Re: Where to put code for stats?
Posted: Wed Sep 03, 2008 6:37 pm
by Tom_M
Works perfect Nick. Thank you very much for your help.
Tom
Re: Where to put code for stats?
Posted: Wed Sep 03, 2008 9:18 pm
by Nick Smart
No problem, glad it worked.
Nick
Re: Where to put code for stats?
Posted: Thu Sep 04, 2008 5:10 am
by Dr.CSS
Please to add [solved] to subject line of first post...