DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

Administrator Manual

Describes the installation and configuration of datamints_piwik.

Target group: Administrators

Installation

The extension can be installed using the extension manager.

Piwik Server

Before your website can be tracked by Piwik you have to add your website to Piwik via the administration area of your Piwik server. You will need the Piwik ID of your site to configure the tracking on your TYPO3 website. You don't need the JavaScript tracking code that is provided by Piwik here, because the extension will build the appropriate Javascript code snippets.

It is recommended for security reasons to always use Piwik over https. Therefore make sure that your Piwik installation is reachable via SSL.

Basic configuration

Follow these three steps to get the Piwik tracking up and running on your website:

  1. Download the extension from the TYPO3 extension repository and enable it. The extension key is datamints_piwik.
  2. Include the Static Template datamints Piwik into the TypoScript root template of your site.
Include Static Template
  1. Basic configuration for the Piwik Tracker is done using the constant editor. To Enable Piwik Analytics tracking in your website, you need to know at minimum your Site ID inside piwik installation and the Path to Piwik installation.
Include Static Template

The extension will now automatically add the Piwik JS Tracking code in the footer of all your pages.

Any constant is represented as a setup property as well (see Configuration).

Note: The static TypoScript template assumes that your main PAGE object is named "page". If you named your main PAGE element differently then please don't include the static TypoScript file. Instead just copy its content into a custom TypoScript template that is part of your setup and adapt the given code by replacing "page" with your own name for the PAGE element.

Advanced configuration

Advanced configuration ist only necessary for using datamints Piwik for the export of annotations. This function is not available for own Piwik installations. Please contact <service@datamints.com> for more information.

Connection settings to datamints Piwik can be made with constant editor in the category DATAMINTS PIWIK: ADVANCED

Scheduler Tasks

The extension provides the following Extbase CommandController Tasks to communicate with datamints Piwik:

Scheduler Task Description Frequency
DatamintsPiwik PiwikConnect: invalidate This task sets the 'processed'-timestamp for sys_note and sys_log entries to current timestamp. This ensures that old logs will not be exported the first time. Initial run
DatamintsPiwik PiwikConnect: exportSysLogs This task exports sys_log table entries as annotation to Piwik. Currently only news (tx_news_domain_model_news table entries) are configured to be exported. One run per day
DatamintsPiwik PiwikConnect: exportSysNotes This task exports internal notes (sys_notes table entries) as annotation to Piwik. Several times a day

Customize Piwik's Opt-Out iframe

Css styles

The Piwik Plugin Custom Opt Out provides an easy way to change the opt-out CSS Styles.

Send iframe-height using Cross-window messaging API

With Piwik 3.x and the Piwik Plugin Custom Opt Out since version 1.0.0, you may inject Javascript to the Opt-out iframe. Using this feature (and the javascript code below) will fit the Opt-out plugin content to the size of the Opt-out iframe on page load.

/**
 * Determine the height of the iframe and use the postMessage method
 * to send the height to the datamints_piwik Extension, which contains an event listener for the message.
 */
(function sendHeight() {
    if (parent.postMessage) {
        var db = document.body;
        var dde = document.documentElement;
        var height = Math.max(db.scrollHeight, dde.scrollHeight, db.offsetHeight, dde.offsetHeight, db.clientHeight, dde.clientHeight);//$('#content-text').height();
        parent.postMessage(height, '*');
    }
})();