There's no 100% reliable way to get this information and still keep the site available to the general public. Most techies are interested only in the hits the server takes, which means the access logs are quite sufficient. Your best option is to generate a unique ID number for each visitor and store it in a cookie on the browser. This would let you build up a profile of each visitor, frequency of visits, etc. The only thing you have to watch out for are users that are unable or unwilling to accept cookies. The percentage is small but significant.
Also, lots of people tend to frown on cookies that "track" their movements, even if it's on one web site, despite the fact that the same information is typically available in the access logs keyed on IP. Watch what you do with these strange new powers.
As HTTP is state-less, any method to tack any sort of persistent or state information (either session-based or user-based) is a hack. The only "sure" way of knowing how many users visit your site is to have each user register, and use something like HTTP authentication to log them in. 99% of the time this is overkill and only serves to keep people away from your site. If you have a lot of content, though (like nytimes.com), you can afford to do this. | [reply] |
I think neither method is perfect. So you better apply all of them, and calculate an average.
Cookies are not very good because:
- not everybody turns on them
- some people are using more machine, and more browser, they will be counted multiple
unique IDs from access logs are also not the easy way to the eternity, why:
- there are gateways and proxies presenting unknown number of users
- robots used to request pages
...and many other pitfalls, so i recommend the averaging method, or trust it on webalizer and other professional (and free:) stuff.
--
tune
"turn off the light, take a deep breath, and relax..."
| [reply] |
Fastolfe you are always the first one to post! :)
Just kidding. Your's is probably a better answer than mine - friendlier anyway!
| [reply] |
Might I suggest trying www.statsmonks.org?
Seriously though - if you really want to code your own stats package in perl - try looking in the Code Catacombs. Alternatively there are gazillions of stats packages on the net.
I think the problem here is that this isn't really a perl related question, or at least it isn't phrased that way. Come back here with some perl code and people might be a bit more interested.
Damn! I just wasted my last -- on this Anonymous Monk! | [reply] |
| [reply] |