Counters

From Lunarpages Web Hosting Wiki
Jump to: navigation, search

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 in your control panel are a better source than counters. Another options would be to use Google Analytics. 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. As such, 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.

How do I reset or change my counter number?

"I want to start my counter over. I want people to think my site has been around longer or move my current counter stats over from another host. I lost all my counters when you moved me to another server."

You can reset your counter(s) in Cpanel under CGI Center, Counter.

Type in the name of the counter to reset (without the .dat), type the new number (without commas), then hit Commit Changes.

If your account is moved to another server, we cannot move the counter files with the account. You will need to recreate the counters on the new server by creating the same counter names you see in your page code. See Counters FAQ

After you recreate the counters, you can reset them to the old count. You will be able to still browse your files on the old server for 5 days after the move to see what the old counters were set at. Use http://oldserver.lunarpages.com/~cpaneluser to browse them and write down the counts. Change oldserver to the old server name and cpaneluser to your cpanel username.

Reset the counters on the new server to the old counts per the above.

Share |
Want to read this in another language?