How Do I CGI ?
BDL How To
BDL Log Tips
Hit History Details
The "hit history" file compiles a running history of how many hits your site received over time. Periodic snap-shot entries are added to the file which contain:
For example, if you wanted to keep a weekly history of the hits to your Web site the history file would look something like this:
- the hit count at that point in time
- the total hits for the period (since the last entry)
- the percent increase or decrease as compared to the previous period's total hits
Last Date Ending Period Percent
of Period Count Total Inc/Dec
--------- ------ ------ -------
08/01/00 10000 n/a n/a
08/08/00 10507 507 n/a
08/15/00 10924 417 -17.8%
08/22/00 11368 462 +10.8%
08/29/00 11902 534 +15.9%
The "n/a" entries are present because when the compilation of the hit history is first started there is no previous data to use as a basis for the calculations. (For information on "seeding" the file, see the next section.)
The period for which you can historically track hits is user-selectable from daily, weekly, or monthly. The name of the file this periodic data is stored in is hithistory.txt and it is located in the same directory as the Bestdam Logger script file.
The .txt file extension of the hithistory.txt file, and the fact that the columns in the file are separated by tabs, results in a file that is very easily imported into spreadsheet and other programs for graphing, analysis, reporting, and presentation. (Be sure to FTP the file from the server using ASCII mode before importing.)
The hit history period is completely independent of the "reporting period" of the script. For instance, you can have the hit history period set to weekly and the reporting period of the script (when it updates logs and e-mails a report) set to daily.
There is a user variable which you can set to include the hit history table in the periodic reports that are e-mailed. However, if the "reporting period" of the script is set to a period less than the hit history period, the same hit history table would appear in multiple e-mails. As a result, this feature is disabled by default.
There are two user variables which allow the creation of a Web page which contains the hit history table. This table can be viewed from anywhere using a browser. As with the other Web pages the script creates, the two variables are a Yes/No setting to create the page and a path variable pointing to the location where the page should be created.
Do not, in any way, change the heading lines of the file (the column titles and dashed lines). The script looks for these lines and changing them could cause the script to fail. The numeric values in the table can be modified provided you follow the instructions in the next section.
"Seeding" The Hit History File
The problem with using the weekly or monthly settings for the hit history is that it can take three weeks or three months before you start to see any "percent increase/decrease" numbers. Simply changing the period to daily for a few days to get some lines in the file won't work because the periodic totals will represent inconsistent periods. If you have historical data available to you, you can manually enter it to "seed" the hit history file. (If you've been using either the Lite or Deluxe editions of Bestdam Logger for awhile and you kept the e-mails it sent, you'll have the necessary historical counts.)
If you wish to seed the hit history file by manually adding lines with past data, there are several very important points to keep in mind:
The formula for calculating the percent increase/decrease is:
- The values on each line must be separated by a single tab. If you add spacing between the columns using the space bar the file will be hosed.
- Do not, in any way, change the heading lines of the file (the column titles and dashed lines).
- The "Percent Inc/Dec" value will always be n/a in the first line. Be sure to enter the n and a in lower case.
- The script only calculates values for lines that it adds to the file (using the last line in file for base values). If you wish to add lines to seed the file, you must calculate the "Period Total" and "Percent Inc/Dec" values manually for any lines that you add.
- Be sure the values you enter are periodically consistent. In other words, if tracking values on a weekly basis, only manually enter past data that are separated by a week's time.
- Whenever you transfer the file, be sure to use ASCII mode.
((A - P) / P) * 100
where A is the hit total for the period being Added and P is the hit total for the Previous period. Using the -17.8% example from the table in the previous section:
((417 - 507) / 507) * 100
(-90 / 507) * 100
(-.1775) * 100