Where to put code for stats?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Tom_M
New Member
New Member
Posts: 4
Joined: Sun Aug 17, 2008 1:18 am

Where to put code for stats?

Post 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
junito
Forum Members
Forum Members
Posts: 28
Joined: Fri Oct 27, 2006 5:07 pm

Re: Where to put code for stats?

Post by junito »

What kind of code do you want to add? Google analytics?
Tom_M
New Member
New Member
Posts: 4
Joined: Sun Aug 17, 2008 1:18 am

Re: Where to put code for stats?

Post by Tom_M »

It's just site statistics analysis software, a bit like Awstats.

Cheers,
Tom
Nick Smart
Forum Members
Forum Members
Posts: 116
Joined: Mon Jul 28, 2008 4:48 pm

Re: Where to put code for stats?

Post 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
Tom_M
New Member
New Member
Posts: 4
Joined: Sun Aug 17, 2008 1:18 am

Re: Where to put code for stats?

Post by Tom_M »

I'll try that Nick. Thanks for the advice.

Best wishes,
Tom
Tom_M
New Member
New Member
Posts: 4
Joined: Sun Aug 17, 2008 1:18 am

Re: Where to put code for stats?

Post by Tom_M »

Works perfect Nick. Thank you very much for your help.

Tom
Nick Smart
Forum Members
Forum Members
Posts: 116
Joined: Mon Jul 28, 2008 4:48 pm

Re: Where to put code for stats?

Post by Nick Smart »

No problem, glad it worked.

Nick
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Where to put code for stats?

Post by Dr.CSS »

Please to add [solved] to subject line of first post...
Post Reply

Return to “Modules/Add-Ons”