hit counters : Java Glossary

The CurrCon Java Applet displays prices on this web page converted with today’s exchange rates into your local international currency, e.g. Euros, US dollars, Canadian dollars, British Pounds, Indian Rupees… CurrCon requires an up-to-date browser and Java version 1.8, preferably 1.8.0_131. If you can’t see the prices in your local currency, Troubleshoot. Use Firefox for best results.

hit counters
Introduction Prices
Java Is Not Suitable Ideal Hit Counters
Types Of Counter Links
Perl Counters


One of the most commonly requested Applets is one that will display the number of visitors to a page like this:

You are visitor number [an error occurred while processing this directive].
The hit counter above is done with SSI (Server Side Includes) . You won’t see anything if you are viewing on offline mirror. The problem with it in Novell is the hit counter is incremented every time the hit counter is displayed, not every time the corresponding file is downloaded. If you display the counter in more than one place, or other than in the file being monitored, you will get inaccurate results.

Unfortunately, it is not possible to write such a program in Java without the co-operation of a server, somewhere to centrally record the current value of the counter.

Hit counters may count hits just to one page, hits to the entire website or number of unique visitors.

Happily there are people who will provide you with free hit counters and free use of their server, usually in exchange for some advertising on the counter. Unfortunately, such pages slow down page loading. The other problem is you must set the up individually. When you write your own code, you can automatically set one up for every page on your website.

Commercial hit counters generally give faster response than free ones. Before you sign up see if you can find some of that vendor’s hit counters on other people’s sites and see how responsive they are. A sluggish hit counter can be very annoying to your visitors.

Some hit counters let you substitute your own set of ten gifs for the digits 0 to 9 to create the counter. With search engines, you can find hundreds of sets of free gifs to use.

There is not much point combing the web for hit counter software to run on your server. Most ISPs (Internet Service Providers) won’t let you run it. They may have some software they have tested they will let you run, usually for a fee. The hit counters on my pages are handled by Novell’s SSI and are sent as ASCII (American Standard Code for Information Interchange) text. Every ISP (Internet Service Provider) will have his own preferred way of doing them, usually with CGI (Common Gateway Interface). When JavaScript is used the scheme could be designed to count or not count offline page views. It would still need an Internet connection to count them.

Java Is Not Suitable

In theory, you could create a Java Applet to display a hit counter. The central site could send the value of the count over in compact binary. However, this would be slower than using CGI since the browser would need to download the Java Applet containing contain code and a complete set of *.gifs for all the digits. Further, the browser user would need to load the Java interpreter. This would take considerably more time than just sending the count or the gifs needed to display the current count. The other problem is the count would not work for people who did not have Java installed or if their Java did not work, or if the Java Plug-In 1.2 had sabotaged the 1.1 version. If there were some way of caching Applets, this technique could be very fast. Perhaps we will see them in future, using smooth animations or other gimickry.

Types Of Counter

There are several possible ways of computing hits.

Perl Counters

The counters on this website were originally implemented with a Perl script invoked with SSI SSI . At the bottom of each page is the following code
<!--#exec cgi=/perl/count.pl -->

When the page is served to the client, the script invoked. It adds one to the number stored in a file called xxxx.cnt where xxxx is the name of the current file. It then inserts the incremented value in place of the SSI.

You can display the value of the count for a file with:

<!--#INCLUDE VIRTUAL=index.html.cnt -->

They did work properly. My ISP has never found the time to figure out why. It looks like the code does not always have permission to update the tiny *.cnt file for each actual file.

Text or PNG (Portable Network Graphics)

Hit counters work by you inserting a small chunk of HTML (Hypertext Markup Language) in your webpages. Usually this chunk contains errors, or is written in a dialect of HTML different from the one you are using. Most commonly, it contains some JavaScript and a load of a JavaScript program. You simply have to clean the markup up yourself.

Counts are generated at the hit counter server and sent to the viewer in one of two forms:

  1. As a constructed PNG images (or in older schemes GIF (Graphic Interchange Format) image) showing the current count made up of a string of digit images strung together.
  2. As a text string of numeric characters.

Which should you choose?

Basically, if you can find text counters that look decent enough, use them in preference to PNGs. Also keep in mind the counter is not the most important thing on the page. You don’t want to draw too much attention to it with bizarre artwork. You might even try sending a hit-counter company a zip of a set of ten digits in PNG form and ask if they would consider supporting them.


Hit Counter Prices
Vendor Free Catches Pay
CurrCon Applet needs Java 1.8 or later to display prices in your local currency.
Technology example

If you have more than 9000 page loads a day they want you to upgrade to the pay version. Tracking HTTPS (Hypertext Transfer Protocol over SSL (Secure Socket Layer)) requires pay version.

$19.00 USD per month.

You have a choice of hit or visitor counts. You use it by putting the visitor count widget on every web page. You can then configure speparate per-page hit counters.

You can’t use the same widget to count hits on more than one page. You would typically register separate widgets for each of your high traffic pages.

Hit counts work with JavaScript (with pure HTML noscript fallback for those without JavaScript) and track geographic information, browser etc. The same markup can collect visitor or per page input the same bit of HTML markup on every page in your website. According to the promotional literature, you can optionally have transparent counters that float over your images, though I could not find the detailed docs on how to do them. You can optionally have invisible counters. They have more documentation than other vendors. They claim to handle 50,000,000+ page views per month. They seem more business-like than other vendors. Optionally, they can generate compact text counters you can decorate yourself with CSS.

The downside is you need 19 lines of markup inserted on each page to install a counter. On top of that it downloads a 9K file of JavaScript source, hopefully only once per session.

You look at a map of the world, see recent visitors and click to find out just which page they read and just where they came from and who wheir ISP was. You can discover that people in different parts of the world are interested in different parts of your site.

They want you to put the counter as the very last thing on the page just before </body>. They could relax that requirement by splitting the markup code in two, part to load the JavaScript and part to place the counter. They may do it that way to simplify markup for their naïve users.

The HTML markup they ask you to insert contains a string that wraps over a line ending. It is best to correct this.

Click projects to view stats and configure control counters.

This is the system I installed on 2014-06-11 for mindprod.com.

See the orange counter at bottom left of this page. Click it to see the statistics.


Must leave a text free hit counters backlink to freecounterstat.com. They do not show ads, even though the website hints they might.

generate a PNG (no stats) or JavaScript (with stats). Opera and Chrome add-ins optionally used to view stats. With JavaScript it appears to be tracking OS (Operating System), browser, country, latitude, longitude, city, IP, IAP (Internet Access Provider) and webpage URL (Uniform Resource Locator). Measures either visitors or hits. You must register the counter for each page separately, so you cannot very well put a hit counter on every page, but you could put the same visitors-to-the-site counter on every page.

There is a very confusing part in the registration process. It shows you a dialog marked OPTIONS. You are not supposed to fill in the fields. Further it will not let you paste values into the fields as it commands. This display is intended as a hint on how to later configure the Chrome add-in.

It can place the counter at various spots vertically on the page far from the markup that generates it.

Oddly, it never asks for your website URL or a password. It gives you all kinds of stats, daily, monthly, cumulative, by geographic location, by browser, by OS , by page, by selected period… The graphics are beautifully done. They offer support in six languages. They are French themselves. They fixed a bug I reported within two days.

Click the orange hit counter just below to see the statistics.
hit counter
supercounters No catches. JavaScript with generated text or PNGs . Focuses on who how many people are online now. Produces maps. Example below done as text. Click the orange counter just below to see the statistics.
hit-counter No catches. No JavaScript. Generated PNGs . Per page hit counters only, no visitor counts. Fairly garish counter art to choose from.
SimpleHitCounter Must leave a backlink to gamelevelingguides. No JavaScript. Sends generated PNG . Not much choice is how the counter looks. Just a hit counter, not a visitor counter. No statistics. See the red or white hit counter below. (orange on transparent not available). eso online guide
online guide
gostats No catches $12.00 USD
per month. Pay version gives you extra statistics.
Works with JavaScript with fallback noscript for people who do not have JavaScript. Sends a generated PNG. Counters must start at 0. They offer several optional wrinkles in the way they count people.
They send an unexpected HTTP (Hypertext Transfer Protocol) 303 redirect when you test the link. Tech support assures me it should work either way.
See orange on black counter just below. (orange on transparent not available).

Search for more hit counter services

Signing up for a free hit counter is a fairly quick process. You might want to experiment with several, primarily to see how much they slow down program loads before making your final selection.

Ideal Hit Counters

Here is my idea of what an ideal hit counter service would look like. I don’t know of any real service that comes close. I don’t know enough JavaScript to write this even if I had access to a cloud to run it on.

Alternatively, a CDN (Content Delivery Network), such as CloudFront, could implement the counters via a type of SSI where the caching servers insert the counts and use a distributed database to consolidate the counts. Counts don’t have to be up to the minute.

Counter Geo: track where visitors to your site are coming from
echo server
gostats.com: free hit counters using JavaScript
Three ways to get a hit counter
web stats
Webring: offers free hit counters

This page is posted
on the web at:


Optional Replicator mirror
of mindprod.com
on local hard disk J:

Canadian Mind Products
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

Your face IP:[]
You are visitor number