drupal development. drupal support. drupal training.

Exclude page hits from Drupal 6 statistics

Published on Wed, 2008-08-06 17:50

The Drupal statistics module doesn't offer a lot in the way on configuration; It's basically either on or off. When it is on, it's not particularly clever about the way that it keeps track of page reads, simply incrementing a counter every time a node is accessed, and there is no control over what counts as a hit and what doesn't.

If your or your site administrators do a lot of work on the site from day to day, writing articles, tweaking things here and there, then every single time they view a post views will be logged, resulting in a skewed post read counter.

For Drupal 5 the solution was to use the Statistics Filter module, and now, thanks to Dave Reid there is the Statistics Advanced Settings module for Drupal 6. Once enabled, you are granted a little bit of fine-tuning over the access log and the content viewer counter via the modules administration page at Administer >> Reports >> Access Log.

You gain the option to exclude specific user roles from logging to the access log, as well as the choice to limit the node read counter to unique users only (on a per-user basis as well as a per session id for anonymous users).

Add new comment