Complete Method For Studying Your Site's Traffic

Providing you're on a *nix flavored server such as offered by HomeBusiness Websites, with access to your Extended Log Format log file there is a script called access.pl http://www.mattkruse.com/scripts/access/index.html you can get for free from Matt Kruse's website. It features:

  • View activity by user and see where they went in your site
  • Date and time, page, status code, and referer info shown
  • View search words used to arrive at your site
  • Re-execute queries by clicking on the [Q]
  • External referring sites are links so you can easily go see who is linking to your page
  • Call the script with an argument like access.pl?25 to only process the last 25 lines (150 is default)

150 lines is not very much information an would probably only be the last couple of hours on your site. So I adjusted this to 9000 which tables the data for almost the whole day sometimes. Actually, I should increase this amount... (see example:)

$tail = $ENV{'QUERY_STRING'};
$tail = $tail || 9000;

[Image]access.plDepending on the amount of traffic you get you would have to adjust the "$tail" to whatever length you want. Every time you view this on the web, this program will update itself every 5 minutes. You can pretty well view your traffic in real time -- if you wanted to...

You can see a sample output, http://www.mattkruse.com/scripts/access/testdrive/example.html of the program on Matt's site.

The beauty of this program is you can practically track everyone who moves on your site. And I like the way it shows you what search engines found your site and the keywords used at specific search engines to find your site.

The only REAL problem with this program is that it is so dynamic, that you can't get a report for the whole day's traffic. Wouldn't it be nice if you could come into your office in the morning and have yesterdays stats sitting on your desktop? For anyone running a special promotion, this would be priceless. Well... the good news is that you can. It just takes a little imagination.

A little while ago, before I started re-modeling this site there was an article here about "BackEnding Tools" that gave you links to information about creating and using web queries with Excel. Excel does not install this feature by default, so if Excel is not web enabled for queries, you will have to install this feature from your Office CD-ROM. Basically, a query looks something like this:

WEB
1
http://yoursite.com/cgi-bin/yourdirectory/access.pl

Selection=AllTables
Formatting=All
PreFormattedTextToColumns=True
ConsecutiveDelimitersAsOne=True
SingleBlockTextImport=False
DisableDateRecognition=False

Web queries have a file extension of *.iqy

[Image]Task Scheduler

So now we have a way to run a web query using Excel which will import the data from access.pl and we have adjusted the "tail" to accommodate the whole day's traffic. Using the "Task Scheduler" that comes with Windows (yes it can be used for other things, other then running "scandisk.") we can open the program and add a new task.

It will prompt you for what program you want to open so you choose Excel. You can see from the above picture that Excel has been chosen from the list. Then we click the "next" button. At the next screen presented to you you can leave the name as Microsoft Excel and tick the "Daily" radio button. We want a fresh report on our desktop every day, right?

The next screen allows you to adjust the time you want the program to run, so you want to choose a time shortly before your server changes it's date. If your location to your server is in the same time zone, I would use 11:45pm -- this is close enough.

[Image]Click advanced

Take note of the above screenshot. The box is "checked" to open the advanced properties after the "finished" button is clicked. This is very important, because at this point we have only told it to open Excel at a certain time every day. We haven't told Task Scheduler what we want to do with it when we open Excel.

Using the "BROWSE" button, locate the query file on your computer and select it.

[Image]Run Task

The path to your query must appear in the "Run" box. The data in the "Start in:" box must not be modified. If you edit this data your query will not be executed properly. Make sure you have the box towards the bottom checked that says "Enabled" and then click "apply" and "OK."

This may be MORE information then you need. I realize this. But I get asked a lot of times what is a good way to study my stats. The way I have presented here is for anyone who needs to understand the path visitors are taking through their site, the amount of time spent on certain pages, the access codes to see if they got everything they wanted, and what page they exited from.

| Back to Article Index |

Copyright © All Rights Reserved. The information/images on this website
may not be reproduced or republished by anyone without permission.