Google
 
Web www.albaspectrum.com
SEO: Creating Your Own Basic Web Statistics Database 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. [%@ Language=VBScript %] [% on error resume next '[-----------------WEBLOGGING START------------------------] dim strpagename,strwho, stradvert dim cn, strconnect dim strip dim strAll_http,strremote_addr,strall_raw

' The Field Below Tells you the page they visited strPageName = request.servervariables("server_name") & request.servervariables("URL") 'The Field Below Tells you the visitors IP Numbers strip = request.servervariables("Remote_Addr") 'The fields below contain all the information such as the website ' that referred them to your page etc. strAll_http = request.servervariables("ALL_HTTP") strall_raw = request.servervariables("all_raw")

set cn=server.createobject("adodb.connection") 'This code connects to your database strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/_private/dbstatistics.mdb") cn.open(strConnect) 'This code inserts the collected information into your database cn.execute "insert into tblstatistics(fldpagename,fldipnumber,fldAll_http,fldAll_raw)values('" & strPageName & "','" & strip & "','" & strall_http & "','" & strall_raw & "')"

cn.close '[------------------WEBLOGGING END -------------------] %]

The Microsoft Access Database must be stored into the _Private folder on your website. If you do not put the database in that position, anyone who visits your website could in fact download your statistics. Apart from that this code will not work. The danger of allowing someone access to your web statistics database is that your competitors could find out who is visiting your website and from where and as such this is really a serious business intelligence issue.

The code shown above has a number of pieces of information that is really useful in working out what is going on with your website. In the field fldPagename the actual page that a person is visiting is stored. In the field fldipnumber the IP number of the visitor is stored. Between these two pieces of information you can find out how a person has entered the site, what they have visited and also with the field fldTimestamp you can work out how long they looked at each page before they moved onto the next one.

The field fldipnumber contains powerful information. On the internet there are a number of lists of who owns what IP Numbers and also which countries they have been assigned to. By collecting the IP Numbers and in conjunction with the IP Database we can work out from what countries people are visiting our website. We can get detailed information to the point of which cities and even the ISP's who are providing the IP Numbers. With this information it allows us to setup our web pages to be in line with the characteristics and attributes that are standard for that country.

Using a Microsoft Access Database as your datastore means that you can manipulate the data and filter it to find out how people are visiting your website and who is referring them. This information is stored in the fldAll_Http and fldAll_Raw fields. These fields will also contain important information such as what browsers and operating systems people are using to visit your website. For example not all browsers interpret HTML in exactly the same way. So if you found that 90% of your customers were in fact using the browser SAFARI which is the Apple Browser then you would be developing your website for this customer base and browser. If 90% of your customers were using Firefox then you would develop your web pages taking into account the idiosyncrasies of that browser.

There is a lot of powerful information contained in these logs and I strongly encourage you to get some Microsoft Access Database Development Experience that will help you analyze the logs even further than what has been discussed in this article.

Remember one thing, when it comes to SEO or Search Engine Optimization it is the web logs that will tell you everything about your visitors and whether or not your SEO Strategies are in fact working.

.

If you would like to download sample files for this project simply visit - Website Statistics. For more information on Internet Marketing visit Online Marketing Business Opportunity. To learn the 13 Secrets all millionaires know to be successful visit Think and Grow Rich

--------------------------------------------------------------------------------------------------

Alba Spectrum popular articles series: FAQ, Reviews, Guides, Introductions, Product Selections, Advises, Definitions, Overviews, online marketing and auctions

We are serving wholesale & retail customers in Illinois, California, Texas, Wisconsin, New York, Washington, Ohio, Michigan, Indiana, Arizona, New Mexico, Louisiana, Florida, Georgia, Minnesota, Utah, Virginia, Georgia, Hawaii, Iowa, Colorado, Ontario, Quebec, Alberta, British Columbia.  We also serve customer internationally in New Zealand, Europe: UK, France, Poland, Italy, Germany, Russia, India, Byrma, Thailand, Holland, Denmark, Sweden, Norway, Indonesia, Austria, New Zealand, Pakistan, Afghanistan, Iran, Spain, Argentina, Brazil, Chile, Uruguay, Paraguay, Peru, Equador, Colombia, Venezuela, Panama, Costa Rica, Canada, South Africa, Nigeria, Portugal, Greece, Turkey, Asia: India, Indonesia, China, Philippines, South Korea, plus business metros: Chicago, Los Angeles, Phoenix, Boston, Atlanta, Minneapolis, Fargo, Seattle, Miami, Orlando, Detroit, Buffalo, Toronto, Paris, London, Montreal, Denver, Warsaw, Berlin, Prague, Rome, Karachi, Sao Paulo, Rio de Janeiro, Moscow, Buenos Aires, Dehli, Mumbai, Beigin, Cairo, San Francisco, Fremont, Naperville, Oakland, Mellburn, Sidney, Sent Petersburg, Tampa, New Orleans, Houston, Dallas, Mexico City, Bogota, Caracas, Lima, Salvador, Recife, Sao Paulo, Rio de Janeiro, Brasilia, Curitiba, Goiania. http://www.albaspectrum.com

110101

110102

110103

110104

110105

110106

110107

110108

110109

110110

110111

110112

110113

110114

110115

110116

110117

110118

110119

110120

110121

110122

110123

110124

110125

110126

110127

110128

110129

110130

110131

110132

110133

110134

110135

110136

110137

110138

110139

110140

110141

110142

110143

110144

110145

110146

110147

110148

110149

110150

110151

110152

110153

110154

110155

110156

110157

110158

110159

110160

110161

110162

110163

110164

110165

110166

110167

110168

110169

110170

110171

110172

110173

110174

110175

110176

110177

110178

110179

110180

110181

110182

110183

110184

110185

110186

110187

110188

110189

110190

110191

110192

110193

110194

110195

110196

110197

110198

110199

110200