View Full Version : Counter Site Application Help?

06-11-2005, 08:32 PM
Hey, I seem to be having trouble with the Counter website application. I tried getting help in live chat but I don't think they knew much about it, as nothing got solved. So I'm going to see if any of you might know..

I installed the Counter site app and added the code to the main page of my website (http://rcfanaticworld.com) At first it seemed to worked ok, but I've noticed that EVERY time I make changes to the page, and re-upload the new copy, the counter starts back at 1. When I went into live chat, my site said 8 hits, the support guy from WH said he was there and it said 30 hits, he told me maybe my browser was cacheing an old copy or something, so I deleted cookies, temp files, and history and it still did the same, then I went to the site on a computer I never visited the site on, and it was up to 13, still not 30 something, any idea whats going on and how do I fix it?

06-12-2005, 08:01 AM
I can't remember off the top of my head but the WH counter writes the number for each page to a file on your server... that is is if they have not changed it since I first looked at it. That would be the place to look and see what the number there says. It may give us some more clues

I just took a look at your page and it only has 2 hits... ok 3 because I refreshed and it increased. :) I could not see anything odd about your source that could be affecting it but only took a quick look. I'll need to dig out my copy of the script and see if I can figure something out. If we can't figure it out would you be interested in an alternative?

06-12-2005, 04:02 PM
The counter program keeps track of hits in the file "/var/www/cgi-bin/whcounter/stats.dat". For example, here is what mine looks like:

$ cat stats.dat

What happens is every time you hit http://rcfanaticworld.com the link to the javascript for the counter that you have is requested by your browser. The trick is the file whcounter.cgi is a perl script that counts how many times it was called and stores that in stats.dat. It labels the hit with whatever you pass as the 'page' parameter. So in my file I'm saying 'page=test.html' or 'test=counter_demo.html'. If you leave the parameter out it will just results in something like "=50" in your stats.dat file.

The counter can only get reset on a page if you change what you are using as the 'page' parameter or if you edit stats.dat. Everything is server side on how it happens so don't worry about anything on your end when troubleshooting the problem.

06-12-2005, 09:59 PM
Thanks Jonnyb0y for the info. I had not had time to look into it for CoteJM. That did refresh my memory though and it sounds like it has not changed. Just took a look at his page again and it looks like he missed settign the page=