Skip to content
Stephen A Thomas edited this page Sep 23, 2013 · 1 revision

Like most web sites and applications, OAE could benefit from a comprehensive web analytics toolkit. Although many commercial sites rely on Google Analytics, privacy concerns preclude the use of a hosted, third-party service by OAE. There are two significant open source projects that provide software for self-hosting a web analytics system--Open Web Analytics and Piwik; however, only Piwik can realistically be considered an active project at this time.

  • Open Web Analytics: 0 commits and 0 contributors in last 30 days; 14 commits and 1 contributor in last 12 months.
  • Piwik: 421 commits and 10 contributors in last 30 days; 3463 commits and 42 contributors in last 12 months.

Requirements

  • Webserver such as Apache, Nginx, IIS, etc.
  • PHP version 5.1.3 or greater (version 5.3 or greater recommended)
  • MySQL version 4.1 or greater
  • PHP extension pdo and pdo_mysql, or the mysqli extension. (PHP GD extension reocmmended)

Installation

To install Piwik, the distribution must be transferred to the analytics host server, at which point a web-based install script can (typically) complete the process. Once the main administrator user is set up additional Piwik users (with restricted privileges) may be added. A single installation can provide analytics for multiple web sites.

For traffic levels anticipated by OAE, additional cron jobs are recommended. These jobs will periodically create and cache analytics reports.

Usage

To use Piwik, web pages on the monitored system must include a JavaScript snippet on all pages. A representative snippet is

<!-- Piwik --> <script type="text/javascript"> 
var _paq = _paq || []; 
(function(){ var u=(("https:" == document.location.protocol) ? "https://{$PIWIK_URL}/" : "http://{$PIWIK_URL}/"); 
_paq.push(['setSiteId', {$IDSITE}]); 
_paq.push(['setTrackerUrl', u+'piwik.php']); 
_paq.push(['trackPageView']); 
_paq.push(['enableLinkTracking']); 
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.defer=true; g.async=true; g.src=u+'piwik.js'; 
s.parentNode.insertBefore(g,s); })();
 </script> 
<!-- End Piwik Code -->

Note that the recommended script is inline, and thus will not be compatible with Content Security Policy best practices.

Analysis

Piwik provides all of the standard metrics for web analytics. A demonstration is available at the Piwik site