Monday, September 17, 2007

http://www.articlejoe.com/Article/SEO--Creating-Your-Own-Basic-Web-Statistics-Database/35868

There are literally thousands of website statistics systems available on the Internet. Some provide complex analysis, whilst others provide very basic information. Sometimes simply due to whom your web provider is you may not be able to install your own statistics applications. I will set out in this article to provide a very basic web statistics database that will allow you to catch whom is visiting your web site and where they are coming from.

The first step in the process of building your own web statistics database is to identify where you will store the statistical information you have collected. In this example, I have decided to store all the data in a Microsoft Access database. I basically created the database in Microsoft Access and called the database "dbStatistics".

The next step is to build a table in which you will store the data. The table in the database will be called "tblStatistics". The table needs five fields and the names are:

fldPageName DataType - Text 255 Characters
fldIPNumber DataType - Text 255 Characters
fldAll_Http DataType - Memo
fldAll_Raw DataType - Memo
fldTimestamp DataType - DateTime Default Value - Date() & " " & time()

The information above simply defines the type of fields each field should be set to and some specific field properties which will be important for this code to work. You will note that there are no primary key fields. The reason this is undertaken is that the AutoNumber function in Microsoft Access is to limiting in the volume of data that you can hold.

You will also notice that there is a field called fldTimestamp. This field allows you to store the exact local Date and Time the person visited your website. The local time is the time on your server that is hosting your webpages.

For this basic web statistic log to work, we now need to get the information into the database. The first thing you need is to ensure that your provider can in fact support ASP (Active Server Pages) pages. Most web hosting companies can support them, but it is worth checking.

We now need to add the code to each webpage that will log information on who is visiting your website and also which websites were referrers and the browsers they were using and what language they were searching in. You will find out all this information in both the fldAll_Http and fldAll_Raw fields.

The following code needs to be copied into the top part of your webpage before the HTML tag.


http://www.articlejoe.com/Article/SEO--Creating-Your-Own-Basic-Web-Statistics-Database/35868