|
Simple Statistics, Statisticus :: Article - 2eNetWorX
|
|||
| 2eNetWorX :: ASP, VB, Asp.Net, Vb.Net, C#, dotNet, .Net OpenSource Projects |
| MyDev | What's New | Projects | Tutorials & Articles | Services | Stats | Contact Us |
| Guest-02583 | /dev :: home :: articles :: statisticus - part #3 | 36 online visitors |
» Contributions
» Recordset Cache » OpenSource » Statisticus » OpenCYA!
» Undocumented... » Ask For Login » DSN'less Connection » Who's Online? » (All Samples)
|
Statisticus, Why and How?
|
| Field Name | Field Type | |
| StatID | Long, AutoIncrement, Primary Key | |
| Date | Date/Time | |
| Time | Date/Time | |
| Path | String | |
| IP | String |
<%
(...)
'Get the data into variables first
sPath = Request.ServerVariables("script_name")
sIP = Request.ServerVariables("remote_addr")
'Assuming we have an open connection and our recordset is rs;
sSQL = "SELECT * FROM Stats"
rs.Open,,, adCmdTable
rs.AddNew
rs("Date") = Date
rs("Time") = Time
rs("Path") = sPath
rs("IP") = sIP
rs.Update
(...)
%>
After we got the data in our table, it's time to analyse it and generate reports.
By executing the following SQL statements, we will get the PageView and Visitor information.
SELECT COUNT(StatID) AS Total FROM Stats
SELECT COUNT(StatID) AS Total FROM Stats WHERE Path = '/index.asp'
SELECT Path, COUNT(StatID) AS Total FROM Stats GROUP BY Path
SELECT COUNT(StatID) AS Total FROM Stats WHERE Date BETWEEN #mm/dd/yyyy# AND #mm/dd/yyyy#
SELECT COUNT(IP) AS Total FROM Stats WHERE Page = '/index.asp'
SELECT Path, COUNT(IP) AS Total FROM Stats GROUP BY Path
SELECT COUNT(IP) AS Total FROM Stats WHERE Date BETWEEN #mm/dd/yyyy# AND #mm/dd/yyyy#
SELECT Path, COUNT(IP) AS Total FROM Stats WHERE Date BETWEEN #mm/dd/yyyy# AND #mm/dd/yyyy# GROUP BY Path
Now we are able to get some basic statistics for our pages, we will use these SQL statements
later for time domain reports; grouped by day, week, month and even hour. Before this, let's
add some more data fields to our table such as Browser, Operating System, Color Depth, Screen
Resolution and Referer.
We will need to use client-side scripting to capture some data using JavaScript which is supported
by most browsers. Then we will learn a common way of executing an external ASP page with some
parameters.
We will capture some more data in fourth part of the article.
Part I - Introduction
Part II - Measurement Tools
Part III - Simple Statistics
Part IV - Adding More Fields
Part V - Data Normalization
Part VI - Data Gets Valuable
| Who's Online |
Bot: Msn
(28) guests
(7) repeated
| Popular Web Sites |
FogBugz Hosting Plans
SubVersion Hosting Plans
SourceGear Vault
Hosting Plans
Note Thing - A Perfect
To-Do List Software
.net Localization
components from SWBOX
| Admin's Toolbox |
| privacy policy , license , disclaimer , © 2000-2004, 2eNetWorX. [page generated in 16 ms.] |