Wednesday, August 08, 2007

Counters

 
 

Counters

How do I create a counter? Can I make it invisible? Do they help?
If you want to know the traffic that is coming to your site and what people are looking at, Analog, Webalizer, and the Raw Access Logs are a better source than counters. Counters only count hits to the page they are located on and will count every access to the page including you viewing your own page while editing and people hitting refresh/reload. They are very inaccurate.

Counters do serve a purpose, however. They can generate interest in a page by showing that many others have looked at it. A very good use of counters is for sites that are broken into separate categories or areas such as image libraries or sites with multiple scripts such as guestbooks, forums, CMS, etc. Counters will tell you which categories/areas are popular and which are not.

Counters may be visible or invisible. Invisible counters are generally linked to another page where they will be visible to the owner of the site only.

You can create a page hit counter in Cpanel under CGI Center. Click on Counter. Select your settings. Be sure to set Max Digits and Style. Type a name into the Counter Name box. It must be a unique name for each counter and while it is stored as a .dat file, you do not need to type in the .dat part. Click on Preview to see how it will look. Make any changes you wish and Preview them until you are satisfied. Click on Make HTML. Copy the code and paste it into your page in HTML/Code mode. It will look like:

img src="/cgi-sys/Count.cgi?df=somename.dat|display=Counter|ft=6|md=5|frgb=100;139;216|dd=Q"

Once you have the counter in your pages, you may edit the code to do some other nifty things.

To add the comma to separate thousands, add comma=T:

img src="/cgi-sys/Count.cgi?df=somename.dat|display=Counter|ft=6|md=5|frgb=100;139;216|dd=Q|comma=T"

To make the counter invisible, add sh=F:

img src="/cgi-sys/Count.cgi?df=somename.dat|display=Counter|ft=6|md=5|frgb=100;139;216|dd=Q|comma=T|sh=F"

To see an invisible counter, you will need to create a new HTML page which can be as fancy or as simple as you like. If you will use it to see several invisible counters, use tables and paste the codes into cells with the names of the pages. In each cell, paste the same code as you used for that page, but remove the sh=F or change it to sh=T. You should also add incr=F to keep the counter from incrementing when you view it from this page.

This page will not be linked to your site. Only you will know where it is. You may want to put it in a folder and password protect the folder to keep others away.



--
Zhipeng Zhang (Alan)   BCompSc  MInfoTech MACS(Prov)

"You must be the change you want to see in the world."

"Begin at the beginning and go on till you come to the end; then stop."
                                                                                       -- Lewis Carroll, Alice in Wonderland

No comments: