Besides the online users counter available for a free download on my web site, there are also many various types of counters. In this article I would like to tell some words about various types of visits counters, about principles of their work and to make some recommendations on how tochoose the most suitable type of counters.
To begin with, it is necessary to remark that the analysis of a website statistics is to be taken on the basis of the data about web site visitors, gathering by the web server (and then register in broad gulls-files) or visit counters (and then register in databases).
Let's outline some general principles of functioning of different types of counters.
All in all,with the counter loading the external program, thus variable is transferred to it. The basic information on the current visitor of a site is stored in these variables, including following information:
* the IP-address of the visitor (REMOTE_ADDR);
* the page Address, whence a visitor has come (HTTP_REFERER);
* the page Address, where a visitor has come (REQUEST_URI);
* Parameters of a call of page (QUERY_STRING).
* the type of the visitor Browser (HTTP_USER_AGENT);
The activation of the external program can be carried out in the different ways, the most widespread way is a picture usage.
Visits counter: a picture
Pages of any web site usually consist of the text and thegraphics. The text is formatted by means of tags, and the graphics represent set of pictures.
The browser paints the page on your screen, forms inquiry to the address http://www.myserver.com/img/picture.gif and the server sends a picture file to the browser. It is necessary to notice that the principle in the work of the counter-picture is based on the capacity of a user’s browser to automatically view your site and to upload all pictures. But often some users disconnect loading of pictures, and robots don't load pictures at scanning sitesat all. It makes it impossible to calculate the number of users with the disconnected loading of pictures, as well as monitoring of activity of robots on a site. By means of the counter-picture we can very well collect the information on the majority of users, however "behind a board" are search robots and users with the disconnected pictures.
Visits counter: a program insert
The majority of web sites is now dynamic and are written with suchprogramming language as PHP, ASP, JSP. So the web site pages are programs and have theirenvironment variables. We can write a code in site language, for example in PHP which will collect the information about visitors and to put it in a database, but not deduce it as a result of work of any visible information. For convenience of an insert of such code in pages, it usually makes out a separate file, and then inserts it into a site pages. However at use of a program insert, there are certain lacks:
* it is possible to take the information on the visitor only from environment variables;
* it is difficult to definethe uniqueness of visitors.
Visits counter: a combined type
The idea is that the code of a program is inserted which a program inserted code of the visit counter, a picture is inserted into pages of a dynamic web site. What turns out?
1. At the moment of a page generation the code of a program insert is caused and received from environment variables and the information is registered in a database.
2. As a result of work of a program insert a java-script -picture code.
3. A java-script worksat viewing a page by the browser.
4. The additional information collected by a java-script about the same visitor is appended in a database.
Some conclusions
You have got acquainted with the basic types of visits counters. I hope that the given information will be useful and will help you to make up your mind concerning a way of gathering of website’s visits counter. Use universal software products which support various types of counters, it will give you the possibility to choose.