BHL
Archive
This is a read-only archive of the BHL Staff Wiki as it appeared on Sept 21, 2018. This archive is searchable using the search box on the left, but the search may be limited in the results it can provide.

Piwik Web Analytics

piwik installation


on bhl-commons host (bhl-mandible)
extracted piwik to /dev/opt/portal/piwik and createed an alias/directory config in the apache config (/etc/apache2/sites-enabled/000-default.conf)

To set up browse to http://bhl-mandible/piwik
invoking
  1. system check
  2. database setup

database configured to use localhost; db name piwik; mysql

Registered a single site: bhl integration generates a tracking code: (which should be automatically bolted in to the drupal pages via the piwik analytics module)

(use site 1 for development / bhl-integration)
<!-- Piwik -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://bhl-mandible.nhm.ac.uk/piwik/" : "http://bhl-mandible.nhm.ac.uk/piwik/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">

try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}

</script><noscript><p><img src="http://bhl-mandible.nhm.ac.uk/piwik/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript>

<!-- End Piwik Tracking Code -->


When setting up further sites use:
site 1: bhl integration
site 2: bhl test
site 3: bhl production

Reporting in drupal uses the piwik-reports module, reporting is via admin/reports