Monday, August 9, 2021

Open Web Analytics for Dokuwiki

Customized PHP header for Open Web Analytics best suited to dokuwiki :



''<?php
$actionkind=@$_GET['do'];
if($actionkind=='') $actionkind='page';
if($actionkind=='page' || $actionkind=='search') {
        require_once('/var/www/stats.mysite.com/owa_php.php');
        $owa = new owa_php();
        $owa->setSiteId('4bda91f72a70c48a2ad1d6cdc11523af');
        $owa->setPageTitle(tpl_pagetitle(null,true));
        $owa->setPageType($actionkind);
//      if(@$_GET['q']!="") $owa->setSearchTerms(@$_GET['q']);
        // Set other page properties
        //$owa->setProperty('foo', 'bar');
        $owa->trackPageView();
}
?>''

It helps sorts the collected data and avoids logging administrative accesses. Note that I did not investigate further to make the "search terms" work Dokuwiki ''q'' argument.

No comments:

Post a Comment