PostNuke Statistics


Live user tracking can provide an invaluable interactive tool for some sites, but if you are more interested in raw data and timeliness is not a factor, a Statistics module might fit your needs better. Statistics often document additional information not found in Who's Online systems. Gathering statistical information does not require special blocks on your pages and will likely have a lesser impact on your site's performance.

Core Stats

PostNuke includes a nice Statistics page as part of its core install package. You reach this page be clicking on the Stats link in the Main Menu. Like the Online block, it has no additional configuration options; you can choose to use it or disable it.

The data is broken up on the page into seven parts. At the top of the page are three paragraphs that summarize the access data, including page view count totals and which days and hours are most or least popular.

The following two sections provide comparative count totals for Browsers and Operating Systems. In Figure 14.6, you can see an example of both Internet Explorer and Netscape/Mozilla visitors using Windows for an operating system.

Figure 14.6. Core PostNuke statistics.


The Visitors by Hour, Visitors by Day of the Week, and Visitors by Month sections all relate to when users like to visit your site. These statistics enable you to predict peak and highusage times when you might need to watch your server load.

Tip

Check your statistics to know when your site is used the least. Schedule server maintenance or upgrades during those low-usage times to minimize downtime for most of your users.


The final section contains a group of Miscellaneous Statistics. The majority are simply count totals of current data in various site modules. In addition, you can conform your PostNuke distribution's version with the final line of statistical data.

Statistics

The Statistics module from Mountain Research and Development (www.mtrad.com) acts as a complete replacement for the core Stats and Referer modules. It combines all collected user data into a unified interface and includes separate reporting functions with detailed options allowing you to generate custom reports. Statistics v5 is included in the book materials, or you can download the latest version from the preceding uniform resource locator (URL).

Unzip the entire contents of the zip file into your modules directory. Regenerate your modules table to initialize and activate Statistics. To complete the installation, you need to make a minor addition to the pnAPI file. In the root of your server is an includes folder; look for the pnAPI file there. The full path to the file is this:

 /includes/pnAPI.php 

Open the file in a standard ASCII text editor. Look for the pnInit function that starts at line 296. Now scroll slowly down to the "other includes" section of the function, which is around line 377. The code you should see is as follows:

 // Other other includes     include 'includes/advblocks.php';     include 'includes/pnHTML.php';     include 'includes/pnMod.php';     // inclusion of pnrender class  jn     include 'includes/pnRender.class.php';     include 'includes/counter.php';     include 'includes/queryutil.php';     include 'includes/xhtml.php';     include 'includes/oldfuncs.php';     // Cross-Site Scripting attack defense - Sent by larsneo     // some syntax checking against injected javascript     $pnAntiCrackerMode = pnConfigGetVar('pnAntiCracker');     if ( $pnAntiCrackerMode == 1 ) {         pnSecureInput();     }     // Handle referer     if (pnConfigGetVar('httpref') == 1) {         include 'referer.php';         httpreferer();     } 

After the Handle referer section, add the following lines:

 // Added for Statistics v5 module include 'modules/statistics/collect.php'; 

Save the file and your module is ready for configuration.

Go to the Statistics Administration page, and click the Maintain Data Tables link in the top navigation. This page allows you to manage the data collected for Statistics. The top two forms allow you to clear out old data, including the removal of data within a specific date range. This is very useful if you feel your site received unrealistic traffic for a period of time and you need to adjust the content to reflect normal numbers.

At the bottom of this form (see Figure 14.7), you have the opportunity to migrate date from the core Stats module. If your site has been live for some time, there might be a great deal of good visitor data maintained by the default Stats module. For most sites, there should be no reason to throw that data away. You can move that data from Stats into the Statistics module by clicking the last Submit button.

Figure 14.7. Managing statistic data.


Now return to the Statistics main administration screen and click the Parameter Configuration link. Initially, Statistics is not actively collecting data. To turn the module on, you need to check the Collect Statistics? check box and submit the form (see Figure 14.8).

Figure 14.8. Managing statistic data.


The rest of the Parameter fields can be left as their defaults to include all collected data, or you can filter and consolidate the data to return a simplified or simply abridged report. Filters are especially useful to remove unwanted data, such as the activity of administrators or search engine spiders. Four filter fields are available:

  • Where to Filter Selects the table you want to filter: Details, Summary, Archive, All Tables, or No Filtering.

  • Pattern to Filter IP Addresses Specifies the IP address(es) that should be filtered out.

  • Pattern to Filter Hostnames Specifies the client hostname(s) that should be filtered out.

  • Pattern to Filter Usernames Specifies the username(s) that should be filtered out.

IP addresses must be entered using a backward slash before the period between numbers, such as 10\.1\.300\.125. Users are filtered by entering their usernames, where multiple usernames should be separated by a pipe | character.

Consolidation options can remove data considered unimportant or too detailed. For example, if you know you only want to see the hourly or daily page views, there is no reason to maintain more detailed information. The table data can be consolidated to keep the simplified data.

Note

Data consolidation is permanent. If you simplify the Statistics data, the details are gone and cannot be recovered.


Click the Maintain Data Tables link in the main navigation bar. Multiple tables are provided to allow you to maintain current data Details, consolidate a Summary report, and Archive old data. You can move data between tables using the Maintain Data Tables page, or simply delete unwanted data altogether.

The Site Statistics Reports page, also available from the main navigation bar, provides the form you use to generate custom reports. The Start Date is automatically populated using the Site Start Date in the Site Settings. By default, PostNuke has "03.2006" in that field, which does not work with the Statistics module. You should change that date, if you have not already done so, and use the format: YYYY-MM-DD.

Set the End Date to a day in the future to generate a report of all data. You must select at least one of the check box options to get results from your submission. You should initially select all options, as shown in Figure 14.9, to better understand what each provides.

Figure 14.9. Customizing your report contents.


The Prose Summary option displays a condensed report in plain sentences above the result tables. The paragraphs are comparable to the data returned by the core Stats module, though a little more clearly formatted.

The Site Content Summary is related to the Miscellaneous Stats table from the core module. It shows additions to Users, Stories, Comments, Downloads, and Links for the site. Unlike Stats, the Statistics numbers are broken out by month and provide a timeline you can use to chart your site's growth.

Statistics has the same counts for Browsers, Operating Systems, and Visitors by Hour, Day, and Month, but it cleanly removes unneeded 0% data from the graphs to make a more polished report. For the Site Content Summary, Page Views, and Details graphs, you also have a drop-down list box to customize the time periods. Each can display information Hourly, Daily, Weekly, Monthly, or Yearly.

The seven listing features in the report are as follows:

  • List of Hosts Ranked by Visits Displays a table listing the names of the hosts that have visited the site and the number of visits, views, and unique pages listed for each host. The listing is sorted in rank fashion by the number of visits made during the selected reporting period.

  • List of Pages Requested Displays the names of the pages requested and the number of respective requests in a table. The listing is sorted in rank fashion by the number of views during the reporting period.

  • List of Downloads Requested Displays a table of downloads requested and the number of requests listed for each file. The listing is sorted in rank fashion by the number of requests during the reporting period.

  • List of Links Requested Displays a list of requested links and the number of times each was requested. The listing is sorted in rank fashion by the number of requests during the reporting period.

  • List of External Referers Displays the external referer links used to access your site with the respective visits and percentages. Internal referers and bookmarks are not included in this report. The listing is sorted in rank fashion by the number of views during the reporting period.

  • List of Referers Displays a complete table listing of all referers to pages in your site with the respective visits and percentages. This list includes internal page links within your site and user accesses by bookmarks. The listing is sorted in rank fashion by the number of views during the reporting period.

  • List of Entry Pages Displays a listing of the pages that were visited first by users. The pages have to be linked directly from another site or accessed through a bookmark. The total entry visits and percentages are also displayed respectively. The listing is sorted in rank fashion by the number of views during the reporting period.

For each listing, a drop-down list box allows you to select the number of items returned: Top 10, Top 20, Top 25, Top 50, Top 100, or All. Ten is the default setting.

You can also set up a Statistics page link using a standard menu block, such as the Main Menu. Go to your site's Blocks Administration table and edit the Main Menu block. For this example, replace the core Stats link with the new Statistics module. Change the Title to "Statistics" and the URL to "{statistics}." Some or all of the other module URLs already entered into the menu might have square [] brackets around the module names. Older modules use those brackets while the newer pnAPIcompliant modules use {} brackets. Now click the Submit Changes button to save the block.

Note

The core Stats and third-party Statistics modules can run concurrently. If you want to keep the link to Stats, just add a new link line as detailed previously, and both modules are accessible.


The Main Menu link is initially visible to all visitors on your site. You can customize permissions to the block link so it only appears to certain groups (use the Main Menu:Statistics: instance), such as administrators, if desired. The separated report and administration components of Statistics make it possible to set permissions for each area.



    PostNuke Content Management
    PostNuke Content Management
    ISBN: 0672326868
    EAN: 2147483647
    Year: 2003
    Pages: 207
    Authors: Kevin Hatch

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net