Quick References
      ADO
      ASP
      CSS2
      HTML
      JavaScript
      Jet SQL
      VBScript
      WML
      WMLScript
      WSH
      XHTML
      XML DOM
      XSLT

Features
      Knowledge Base
      Tutorials

Partners
     ZVON.ORG
     XML
     Planet Source Code
     VisualBuilder
     Web Design
     Your HTML Source
     XML/XSLT Forums
     ASPAlliance
     Scripts
     
     Programmers Heaven
     Tek-Tips Forums
     Developer Fusion
     Code Project



Configuring and Running Reports


Configuring The Report Script
The final step to automatically producing reports is to configure the Adrpt.vbs script. Ensure that this exists in the Site Server/Bin directory, along with the accompanying Adexport.vbs and Adlogconvert.vbs scripts. If not, copy them from the installation CD.

1.   Open the Adrpt.vbs script in a text editor, and near the top you'll find a configurable section beginning with the words 'Begin Configuration Section. Customize this part'. Firstly uncomment the database section depending on whether you set up Site Server Analysis with SQL Server or Access.

      ' strUADB = "sa:@server/SSA"
      strUADB = "c:\Microsoft Site Server\data\msusage.mdb"

2.   Set the Ad log source path to read 'Log data source' (as set in Usage Import).

      strAdLogSource = "Log data source"
      strContentLogSource = "IIS Logs"

3.   Next set the Site ID. To find out what this is, open up Usage Import as you did previously, and then go to the File menu and click 'Database Contents'. A table will appear, and the site ID is the fourth field in that table.

      strSiteID = "28"

4.   Set 'fImportContentLogs' to False, save the changes made to Adrpt.vbs, and exit.

      fImportContentLogs = False

Those are all the changes required to ensure that the script runs correctly, but there are a few other configurations we can make by altering other variables. These include:

  • fDeleteFiles:
    Specifies whether to delete log files after processing and importing them. The default value is False, and this is the safest option, especially if you alter the script to extract information directly from the original IIS files in their home directory.

  • strInputDir (optional):
    Specifies the directory where incoming log files are located. The default directory is %SiteServerDir%\data\adlogs.

  • strWorkDir (optional):
    Specifies the directory where temporary files are written. This can be the same as strInputDir or different. strWorkDir should be set if the script doesn't have write permission on the input directory or if the input directory is a network share. It defaults to being the same as strInputDir.

  • strReportDir (optional):
    Specifies the directory where reports should be generated. The default is
    %SiteServerDir%\Data\Reports\Advertising. The log file (adrptlog.txt) is also written to this directory.

  • arrReports:
    Specifies which reports should be run.

Running The Report Script
There are a couple of ways you can run the report script 'adrpt.vbs'. Firstly, however, ensure that the directory 'adlogs' exists in Microsoft Site Server/Data, and then copy the IIS log file(s) you want to produce a report from to it. These files will have names similar to 'ex000704.log' where the numerals represent the date as YYMMDD. (The beauty of this script is that it can easily be modified to do such things as copying the preceding day's log file to the adlogs directory automatically.) Then, make sure that Usage Import is closed, that IIS is running, and that the windows NT account into which you are logged has access permission to Ad Manager as the script uses Ad Manager to obtain certain information. Then you can either open a DOS window and type in

cscript "C:\Microsoft Site Server\bin\adrpt.vbs"

or go to the Site Server bin directory, right-click on Adrpt.vbs and click either 'Open' or 'Open with Command Prompt'. (At this stage you will see various messages concerning the progress of the script; this is for the purpose of debugging and can be turned off by going to the configurable section of the 'Adrpt.vbs' script and setting the fDebug variable to 'False'.)

Once the script has finished running, you will find the log file 'adrptlog.txt' and a number of reports in the reports directory as specified in the configurable section of the script. These standard reports are:

  • Ad Server Summary Report:
    Gives summary details of every advertisement including start date, the number of ad events ordered, and information on requests and clicks; weekly details of ad requests, clicks and click rates.

  • Advertising Detail Report:
    Gives a detailed breakdown of ad requests, ad clicks, and ad click rates by day for all advertisements and advertisers; and ad requests and ad click rate for each advertisement over the last 3 weeks sorted alphabetically by advertiser and by number of ad requests.

  • Advertising Placement Report:
    Shows the top 25 locations on your site that serve advertisements ranked by ad click rate; the top 25 locations on your site that serve advertisements ranked by number of ad requests; and the advertisements shown on your site listed alphabetically with the top locations based on ad requests displayed for each ad.

  • Advertiser Detail Report:
    Shows aggregate advertisement statistics; the top 25 advertisers based on aggregate number of ad requests for their advertisements; and your advertisers listed alphabetically detailing the performance of each of their advertisements

  • Advertising Overview Report:
    Details the daily trends in the number of ad requests for the entire advertisement inventory on your site; the daily trends in ad click rate for the entire advertisement inventory on your site; the number of advertisers and advertisements active on your site for a given week; the top 10 locations on your site that serve advertisements ranked by number of ad requests; the top 10 advertisements ranked by ad click rate over the analysis period; and the top 10 advertisements ranked by number of ad requests over the analysis period

Here you can see some of the detail from one of the standard reports:

Now that we have our first standard reports, let's look at how we can produce a custom report for one of our advertisers.

 
  1 2 3 4 5 6 7
 
   
Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information
knoxville photographer
knoxville wedding photographer