Finding Out Who s Viewing Your Web Pages

Finding Out Who's Viewing Your Web Pages

Now you've got your site up on the Web and ready to be viewed, you've advertised and publicized it to the world, and people are flocking to it in droves. Or are they? How can you tell? You can find out in a number of ways, including using log files and access counters.

Log Files

The best way to figure out how often your pages are being seen, and by whom, is to get access to your server's log files. How long these log files are kept depends on how your server is configured. The logs can take up a lot of disk space, so some hosting providers remove old logs pretty frequently. If you run your own server, you can keep them as long as you like, or at least until you run out of room. Many commercial web providers allow you to view your own web logs or get statistics about how many visitors are accessing your pages and from where. Ask your webmaster for help.

If you do get access to these raw log files, you'll most likely see a whole lot of lines that look something like the following. (I've broken this one up into two lines so that it fits on the page.) - - [17/Feb/2003:12:36:51 -0700]   "GET /index.html HTTP/1.0" 200 8916

What does this information mean? The first part of the line is the site that accessed the file. (In this case, it was a site from the United Kingdom.) The two dashes are used for authentication. (If you have login names and passwords set up, the username of the person who logged in and the group that person belonged to will appear here.) The date and time the page was accessed appear inside the brackets. The next part is the actual filename that was accessed; here it's the index.html at the top level of the server. The GET part is the actual HTTP command the browser used; you usually see GET here. Finally, the last two numbers are the HTTP status code and the number of bytes transferred. The status code can be one of many things: 200 means the file was found and transferred correctly; 404 means the file was not found (yes, it's the same status code you get in error pages in your browser). Finally, the number of bytes transferred usually will be the same number of bytes in your actual file; if it's a smaller number, the visitor interrupted the load in the middle.

Access Counters

If you don't have access to your server's log files but you'd like to know how many people are looking at your web page, you can install an access counter. These counters look like odometers or little meters that say "Since July 15, 1900, this page has been accessed 5,456,234,432 times."

Many web counters are available, and some of them require you to install something on your server or use server-side includes. These days, there are a number of access counters that you can incorporate into your website without installing anything. They use JavaScript and images located on their own servers to keep track of the visitors to your site.

The web counter at is easy to set up and is very popular. If you have a site without a lot of hits (fewer than 1,000 a day), the counter service is free. Otherwise, you'll need to be part of the commercial plan, costing $30 and up.

After you sign up for the counter service, you'll get a URL that you must include on your pages as part of an <img> tag. When your page is hit, the browser retrieves that URL at's server, which generates a new odometer image for you.

You can find a list of other free counter services in Appendix A.

If you'd like to go a step further in collecting statistics using an access counter, check out Hitbox at Its counter is invisible, and you can go to the Hitbox site to find out how many people have accessed your site, along with a lot of other information. It provides a lot of information for you and doesn't force you to deal with log analysis yourself.

Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day
Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day (5th Edition)
ISBN: 0672328860
EAN: 2147483647
Year: 2007
Pages: 305

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: