Once a year I have to make some stats on activity per user, types of action, and the pages/namespaces that are hot.
For this I include a short php snippet in the footer of the template.
It will write the following details to a logfile.
Its fast and easy to read this file into e.g. Excel and analyse it for example with Pivot tables.
I use jpgraph to make images on the fly.
$filename =dirname(__FILE__).'/log.txt'; $timestamp = date("Y:m:d:H:i:s"); $user = $_SERVER['REMOTE_USER']; $id=addslashes($_GET["id"]); $id.=addslashes($_POST["id"]); $action=addslashes($_POST["do"]); $action.=addslashes($_GET["do"]); $logentry=date("Y")."|".date("m")."|".date("d")."|".$timestamp."|".$user."|".$action."|".$id."\r\n"; if (!$handle = fopen($filename, 'a')) {exit;} if (fwrite($handle, $logentry) === FALSE) {exit; } fclose($handle);
As said, this is a quick and dirty way to collect rudimentary statistics.