The best (and most accurate) way to get to the information you want is to access the server logs directly. With log access you can track "user visits" as opposed to raw page hits by correlating visits with time and such. There are lots of freeware Perl log analyzers out there that will do this for you, but the trick is getting the log data in the first place.
Unfortunately not everyone has access to the logs. If that's your situation you can try a technique I've used before with some success. On your main page (or any page you want to count visits) put a <img src="counter.pl"> tag somewhere on the page. "Counter.pl", when called, adds a count to a file somewhere, and then sends back a 1 pixel invisible gif to the browser.
The cool thing about this is that you're making use of a browser's cache behavior to prevent the same visitor from making multiple log hits. Most browsers will cache the output of counter.pl and not re-call the script if someone hits the same page later. Cool, yes?
Of course, it's not perfect as you are depending on the browser to prevent multiple counts (and believe me, it's never a good idea to depend on a browser to do anything :-P) but it should be more accurate than simply counting raw hits like you started with.
Gary Blackburn
Trained Killer
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.