English version | Home | Projetos | Artigos | Cadastro | OnLine | Sumário | Contato | Chat | Sexta-feira, 19/Abril/2024 |
Conecte-se | /dev :: home :: articles :: statisticus - part #3 |
» Adiciona Favoritos
|
Statisticus, Why and How? by Hakan Eskici 3. Simple Statistics
In the previous part, we described
what we want to learn; pageviews, visitors and averages.
With such a table structure, we will be able to learn "PageView and "Visitor" statistics. Here is the code using the "Stats" table to store the data;
<%
After we got the data in our table, it's time to analyse it and generate reports. Total Page Views SELECT COUNT(StatID) AS Total FROM Stats Page Views for a Specific Page SELECT COUNT(StatID) AS Total FROM Stats WHERE Path = '/index.asp' Page Views Grouped by Pages SELECT Path, COUNT(StatID) AS Total FROM Stats GROUP BY Path Page views for a specific time period SELECT COUNT(StatID) AS Total FROM Stats WHERE Date BETWEEN #mm/dd/yyyy# AND #mm/dd/yyyy# Visitors for a Specific Page SELECT COUNT(IP) AS Total FROM Stats WHERE Page = '/index.asp' Visitors for each Page SELECT Path, COUNT(IP) AS Total FROM Stats GROUP BY Path Visitors for a specific time period SELECT COUNT(IP) AS Total FROM Stats WHERE Date BETWEEN #mm/dd/yyyy# AND #mm/dd/yyyy# Visitors for each page for a specific time period 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.
Part I - Introduction |
|
[ processado em: 2,59 segundos.] | privacidade | licença | © 2001, Dammous. |