Access Counters


Taking the Pulse of your page

Access Counters are useful scripts (usually written in PERL or C) that allow monitoring of how many times a page has been visited. Business often use counters to measure their exposure to potential customers through their web pages. The are generally two kinds of counters used on web pages: standard ("true") counters and clock displays.

Standard Counters

Standard counters record the page access count ("hit count") in a file and update the file. Some complex counters may require a small directory structure of their own for the images used to display digits, security and configuration files, etc. The counter's associated script reads the file and adds 1 to the contents. "Smart" counters check to avoid counter terrorism, the deliberate repeated accessing of the counter to artificially inflate the value (and, thus, the perceived frequency of visits to the page).

Clock 'counters'

Clock counters call upon the web server machine's time-of-day clock to determine the current time. This time is displayed in a format similar to the counter display (usually with a stylized border and numbers). The clock display is not subject to counter terrorism, and, in some cases may be able to determine the browser's time zone.

Who can use counters?

The answer to this depends on your web server setup. Generally, anybody can use a counter, so long as they can access the cgi-bin directory on the server OR use CGI scripts in their home directory structure.

How do I use a counter?

The setup of counters is not standardized. Each of the counter resources listed below has its own description of how to set up the counter script on the Web server. The FortNet server already has one such counter, www-count set up. The code you include in your HTML looks like this:

<IMG ALT="[Try a graphic browser to see the counter!]" ALIGN=BOTTOM 
SRC="/cgi-bin/Count.cgi?df=accctrpres.ctr">

The code above creates a counter that looks like this:

[Try a graphic browser to see the counter!]

Many of the parameters for the counter are optional. We could have shortened the line above, but would have lost control over some of the formatting.

[Try a graphic browser to see the counter!]

Note that two different values are displayed above (for the counter). Each time the counter is accessed, its value is increased, even if the counter is accessed several times in one document!

The counter data file (accctrpres.ctr) must be unique (i.e., not have the same name as a counter used by somebody else); it is safest to have this file set up by the systems administration staff for your web server.

WWW Resources about Counters

WWW Homepage Access Counter
Digit Mania
CronCount 2.0 BETA
City Of Night - Doing Page Counters
David's How-To: In-line counters
KCounter v.1.0 - Moved without notice, let us know if you find.
Web-Counter Home Page
Yahoo Search Results