Advanced HTML Guide

Website Analytics

Once you've spent time creating your website you'll probably want to know how successful you have been. You'll probably want to track how well your site performs over time. The are various tools out there that can give you information about how many visitors you get, how many pages they view, what browser they are using, what country they are from, and how long they spend on your site. Other tools will give you information about how well indexed your pages are and if any errors have been encountered. I'm going to be looking at a number of different tools that I find useful.

Google Analytics

Using Google Analytics

One of the best tools out there is Google Analytics. This will collect information about how your site it viewed and then present it in graph or table form. You can track information about multiple websites if you own more than one.

In order to use it you first need to sign up for a free Google Analytics account. You'll then need to tag all the pages that you want to track. If you use a common page footer as described in my PHP tips page then this can be done by modifying a single file to include the tracker code snippet.

This tracker will send a large amount of information into the Google Analytics database which you can then view and analyse at your leisure.

The tracker relies on JavaScript so it will only work on JavaScript enabled browsers. This is likely to lead to you getting an underestimate of the total visitors but the results are good enough to be very useful.

One of the big advantages of using 'page tagging' rather than analysing log files is that the report generation is completely automatic. You don't have to spend time downloading log files and running report generation tools.

The front end of Google Analytics is the Dashboard which is shown on the right. This gives an overview of some of the major statistics. You can then drill down into much more detail. If you want to know what keywords people are using to find your site you can examine them in detail. If you want to see what keywords people were using a few months ago - no problem! As Google stores all the data it is easy to compare your current statistics with older statistics.

One useful tip is to filter out any page views from your own IP address so you get a more balanced view of what your viewers are doing. Google Analytics makes it easy to do, but you'll have to check if you have a static IP address for this to work.

Website log files

Analog web log file analyser

Most commercial webspace providers will give you access to the raw log files generated by people visiting your website. These logs record each access to any file on your web server. A typical line in a server log file might look like this: - u4535511 [09/Jul/2008:08:22:20 +0100] "GET /html/website-analytics.html HTTP/1.1" 200 481 "" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)" "-"

This tells you which files was downloaded, at what time, from which IP address, details of the referring page and details of the browser and HTTP status code.

Web logs record all downloads of your HTML pages, images, and even erroneous access attempts. The ability to give you information about erroneour access attempts (e.g. 404, 401, 500) error codes is one of the big advantages of analysing the raw log files rather than using an on-page tagging solution like Google Analytics. The other advantage is that your viewers don't need to have JavaScript enabled in order to be counted as the logging is done at the server level.

The disadvantage of using raw log files is the added complexity. Firstly you'll need to get the logs off your web server. This will probably involve downloading them using a FTP package. You'll then need to run the logs through a logfile analysis tool such as Analog. This may not be as easy as it sounds as there are many different log file formats out there. You'll need to configure your log file analysis tool to recognise your log file format. For example I use this line to tell analog about the 1&1 log file format.

LOGFORMAT (%S - %u [%d/%M/%Y:%h:%n:%j %j] "%j %r %j" %c %b %v "%f" "%B" "%j")

If you don't think you'd be confortable working out how to configure a package like Analog for your own log format then you are probably best of sticking with Google Analytics. If you can figure it out then you'll get access to much of the same information as Google Analytics would provide - however it will be:

  1. More accurate as you won't be relying on people having JavaScript enabled and
  2. You'll get full details of any errors that may have occurred. For example you'll be able to find out if you have links pointing to non-exising pages.

Analog will produce reports in the style of the above right image. It is very configurable and if you spend a bit of time with it then you can produce all kinds of interesting reports.

Google Webmaster Tools

Google Webmaster Tools

You may notice that this is the second tool from Google that I'm writing about. Google Analytics is all about giving you information about your website readers. Google Webmaster Tools gives you information about how the Google search engine sees (or perhaps doesn't see!) your website.

In order to use it you'll need to sign up for an account and then verify each of the sites that you want to add. This verification step is used to prove that you are the owner of the website for which you are trying to get information. You can verify the site by either uploading a single file to the root of your website, or by adding a meta tag to your home page.

Once your site is verified then data will start being collected. You will be able to gain information such as:

  • Any errors Google encountered whilst trying to index your website. For example any links which didn't work. Errors in your robots.txt files and any sitemap errors.
  • Information about problems in your title of meta tags. For example Google can warn you if it things your page descriptions are too short.
  • The queries that caused your pages to appear in the results and the queries that caused people to visit your site.
  • How Google sees your pages.
  • Information about the links to your website.
As well as giving you information you get access to a number of tools.
  • A tool to submit a sitemap and to view any errors or messages associated with it.
  • robots.txt validator.
  • Preferred domain selector - would you prefer all links to point to a www or non-www version of your site.
  • A URL removal tool.
  • Geographic target selection tool.

Yahoo Site Explorer

Yahoo Site Explorer

Yahoo Site Explorer is Yahoo's version of Google Webmaster Tools. Like the Google version it will allow you to view some extra information about how your site is indexed by Yahoo. It is however much more limited.

You first have to validate your site - again by using a validation file or meta tag.

Once validated you can then submit sitemaps to Yahoo. You get a tool to change how dynamic URLs are indexed. And you can view inbound links into your site. And that's about it. It is fairly underwhelming compared to the Google offering.

Microsoft Webmaster Tools

Microsoft Webmaster Tools

Microsoft Webmaster Tools is Microsoft's collection of webmaster tools. As with both Google and Yahoo's versions you must authenticate your websites and then you can use the tools. You get access to the following:

  • A sitemap submission tool.
  • Information about your top ranked pages.
  • Backlink checker.
  • Keyword checker.
  • Top outbound link viewer.
  • robots.txt validator.

You get more than with Yahoo's tools but not as much as Google will give you.


There are some great tools out there to help you gain more insite into your website. Which ones do I use? I use all of these.

I use Google Analytics on a daily basis to check my daily viewing figures. I will analyse my raw logs on a periodic basis to see if there are any errors that I should know about. I check Google Webmaster Tools weekly to ensure there are no errors on my site. I check Yahoo Site Explorer and Microsoft Webmaster Tools occasionally just for interest or if I need to resubmit a sitemap.

Further Reading

Advanced  HTML
Privacy Policy
Advanced HTML Home
Copyright © 1997 - 2016
Hosted by 1&1