How to add a homepage counter

vistors so far....

Applicable only for webpages on
www.morris.umn.edu or cda.morris.umn.edu
If you are at another site, look at installing a Web Page Counter by Muhammad A Muquit
or the Pagecount advertiser-supported service.


What does a page counter do?
The page counter is a CGI (common gateway interface) program that is executed everytime someone visits your homepage. The sole purpose of the program is to:

1. Lookup your page's current count
2. Increment the count by one and save the new count
3. Print out a gif graphic to be shown on your page

Adding your page counter
Once you have your counter
data file, the basic counter is inserted into your page with the following html tag:

<img src="/cgi-bin/Count.cgi?df=data.dat">

Resulting in a counter like:

NOTE: Regarding counter data files on www.morris.umn.edu and cda.morris.umn.edu, you must have an account on one of these machines to have a counter file. To have an account on one of these machines, you must be faculty, staff, or currently registered student at UMM.

www.morris.umn.edu page counters
Data files are created automatically for www.morris.umn.edu page counters when they are used for the first time. Please follow the guidelines below for establishing the name for your data file. "data.dat" should be replaced with a file name specific to your username or directory and the file that contains the counter. For example if username is 'johndoe' and the counter is added to your index.html page, a suggested data file name would be 'johndoe_index.dat'. The key is for all counters to refer to individual data files to avoid redundant counts.

cda.morris.umn.edu page counters
On cda.morris.umn.edu the data file for a page counter must be set up before the counter can be used. To request a data file for your counter, please send email to
Mark Van Overbeke (markvo@cda.morris.umn.edu) with information that you need a page counter and the file name (e.g index.html) that the counter will be used on. Shortly after, you will receive a reply with the name of the data file for your counter. Insert that name in the 'df' field of the image tag for the counter as shown above.

Counter Options
Additional counter options are documented at the Web Page Counter Homepage.

The more useful options include:

Additional digit designs
The counter can display various counter digit styles that can be viewed at: http://www.morris.umn.edu/committees/wwwac/toolbox/digits.html. Just note the letter next to the style of your choice and add it to the image tag for the counter such as:

<img src="/cgi-bin/Count.cgi?df=data.dat|dd=G">

Hidden counters
Sometimes it is useful to have a hidden page counter to inconspicously monitor the use of the page. The counter can be replaced by a transparent gif picture by using the 'sh' option, which stands for 'show', and setting it to false:

<img src="/cgi-bin/Count.cgi?df=data.dat|sh=F">
Since the counter is now hidden, it is necessary to make another page to actually display the counter. On that page simply reference the same counter data file, but use the 'incr' (increment) option set to 0 to display the counter and not increment the counter to throw off the accurate count.
<img src="/cgi-bin/Count.cgi?df=data.dat|incr=0">

[ Campus Homepage | WWW Advisory Group Homepage | Web Toolbox ]

The University of Minnesota is an equal opportunity educator and employer.
Copyright 1997 University of Minnesota, Morris
[an error occurred while processing this directive] Last Modified Tuesday, February 01, 2005
Page URL: http://www.morris.umn.edu/committees/wwwac/toolbox/counter.html