Chapter 1. EXT: piwikintegration

Extension Key: piwikintegration

Language: en

Keywords: piwik, backend, frontend, templavoila

Copyright 2000-2008, Kay Strobach, <typo3@kay-strobach.de>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.org

1.1. 

What does it do

The extension implements Piwik tracking in TYPO3-based websites.

Piwik is a new open source (GPL license) web analytics product. It gives interesting reports on your website visitors, your popular pages, the search engines keywords they used, the language they speak… and so much more. To learn more about Piwik, go to http://www.piwik.org.

This extension is a addon to the extension of EXT:piwik which provides a Backendmodule and integration functionality to TYPO3.

Screenshots

Piwik in Backend

Module without skin extension

Module with skin extension TYPO3Menu

EXT:templavoila with preview

Piwik wiget in TYPO3 frontend

Administrative functions in backendmodule

The Backendmodule is devided into 3 parts:

I would call it dashboard, it's simply a page which shows the most important widgets

Direct Access to Piwik

API-Key, JavaScriptTrackingCode display for use in external tools

GeoIPDatabase Download / Refresh and Install (coming soon)

Scheduler Integration

In TYPO3 4.3 there is a new Extensions called scheduler. You need this Extension to use this feature.

Create a new task. If the task is executed you do not need to wait to see the statistics.

Have a look on http://piwik.org/docs/setup-auto-archiving/ to get more information on speeding up piwik. (ignore the cronjob, as this is executed by the scheduler).

Please have a look on these options in the piwik configuration.

[General]time_before_today_archive_considered_outdated = 3600enable_browser_archiving_triggering = false

Supported Languages for BE Module

  1. English as default

  2. German

Supported Languages in Piwik

Please look into the official piwik blog to get the full list of available languages http://piwik.org/translations/.

Installation

Automated Installation

To integrate piwikintegration into your TYPO3 installation follow these steps:

  1. Install the extension via TER, piwik is not included!

    1. Install and enable the EXT:piwik which is suggested, to get the Trackingcode automatically.You do not need to configure EXT:piwik it's configured with the static template of EXT:piwikintegration (see below).Have a look in http://typo3.org/extensions/repository/view/piwik/current/ for setting up advanced options of EXT:piwik. You do not need to do this here.

  2. Enable the plugin EXT:piwikintegration.

  3. Add the static template of piwikintegration (this will enable a single idsite and add the needed ts-configuration for EXT:piwik, as described above)

  4. Open the statistik module, click on the page or a subpage, where you have added the static template

    1. The backendmodule now recognizes, that piwik is not installed (by checking, if the config file exists).

    2. The backendmodule will now download, extract and install the latest piwik release into typo3conf/piwik.

    3. The backendmodule will now reload and now you're able to use piwik via the backendmodule of TYPO3.

  5. If you like to use GeoIPDatabase use the admin functions of the module and download the database from maxmind.

That's all you need to start tracking your visitors. See EXT:piwik manual for more config options and description of the parameters.

Manual installation (draft may not be complete)

To integrate piwikintegration into your TYPO3 installation follow these steps:

  1. Install the extension via TER, piwik is not included!

    1. Install and enable the EXT:piwik which is suggested, to get the Trackingcode automatically.You do not need to configure EXT:piwik it's configured with the static template of EXT:piwikintegration (see below).Have a look in http://typo3.org/extensions/repository/view/piwik/current/ for setting up advanced options of EXT:piwik. You do not need to do this here.You do not need to install EXT:piwik, if you integrate the trackingcode on your own. But you need to setup up the siteid like described in http://typo3.org/extensions/repository/view/piwik/current/ in the EXT:piwik manual. This is needed, because EXT:piwikintegration uses the same setup as EXT:piwik

  2. Install and enable the plugin EXT:piwikintegration.

  3. Copy Piwik in typo3conf/piwik/piwik so that the index.php is accessable via typo3conf/piwik/piwik/index.php

  4. Setup Piwik with the same database parameters as the one for TYPO3You need to set the prefix to “tx_piwikintegration_“ as this is needed for EXT:piwikintegration.

  5. Open the statistik module, click on the page or a subpage, where you have added the static templateThe backendmodule now recognizes, that piwik is correctly installed (by checking, if the config file exists). And will show the overview page.

  6. Don't forget to install the TYPO3* Plugins in PIWIK.org, especially the TYPO3Auth plugin is mandatory for authentification against the TYPO3 Session. If this works you can disable the Login plugin.

  7. If you like to use GeoIPDatabase use the admin functions of the module and download the database from maxmind.

That's all you need to start tracking your visitors. See EXT:piwik manual for more config options and description of the parameters.

Upgrade

From 0.x to 1.x

No upgrade path

From 1.x to 2.0

Simply upgrade via TER, update the TS Setup with the new Option, after opening the BE Module piwik gets installed and you're done.

Don't forget to install EXT:piwik for automated adding of the trackingcode. → Please check your page for the trackingcode as non logged in BE user, as EXT:piwik from version 2.x won't log authenticated BE Users.

From 2.0.x to 2.2.x

There is a new Piwik Plugin called TYPO3Menu which is shipped with version 2.1.0.

This plugin switches the gui of piwik into a more TYPO3 like style. You need to activate it manually, as EXT:piwikintegration tries to not touch your config if not really needed. The shipped Extensions have the same Version as EXT:piwikintegration by architecture. That makes it easy for you to find the correct plugins.

Settings in Extensionmanager

Enable features

EXP. - independent mode [enableIndependentMode]

EXT:piwikintegration contains a basic tracking JS; please don't enable this mode in EM if you have installed EXT:piwik, it will result in doubled Trackingcode in the Frontend.

Enabled heavy logging for the piwik... [enableSchedulerLoging]

As described it logs every action of the scheduler cronjob the the table sys_log.

Enable heavy logging for the piwik cronjob - should be off in production environments as this can result in very large tables.

Please use this function for debugging only.

How does it work?

  1. User opens statistik module for a specific page → TYPO3 checks access → Module inserts access records to piwik tables automatically (admin as superuser, normal user with view rights)

  2. load piwik in iframe / object tag

  3. Authenticate user against TYPO3 be_users table with the user of the be cookie.

  4. That's all.

Statistics on your Desktop

Data for piwik-api use

Piwik API Key / token_auth / API Code

Is supported, currently you need to set up the api key manually. See be_users form for that.

Currently there is also the way to set a key via the backend module statistics, but this is deprecated.

  1. Select Page

Piwik API URL

Please take a look into the statistics BE Module to get the url for piwik API normally it should be:

DOMAIN/typo3conf/piwik/piwik/

Applications

There are 2 Adobe Air Applications, which enable you to see the statistics on your desk, without login into piwik.

  1. Desktop Web Analytics - For Piwikhttp://www.desktop-web-analytics.com/

  2. Piwik Connectorhttp://www.piwik-connector.com/en/

FAQ

What do I have to do if the installation fails with:There is no valid unzip wrapper, i need either the class ZipArchiv from php or a *nix system with unset path set.

You have 3 opinions:

  1. Manual setup → hard

  2. Install Zip Extension for PHP

  3. Do not use Microsoft Windows and disable $GLOBALS['TYPO3_CONF_VARS']['BE']['disable_exec_function']

Use with ks_sitemgr (currently not published in TER)

Use the customer id constant to setup the trackingcode – example will be provided later.

What to do if piwik can't update?

There 2 possible solutions

  1. Manually unpack the archive into typo3conf/piwik

  2. make a list of installed plugins and settingsdelete the typo3conf/piwik directorymake a clean installreconfigure piwik

Appendix

Changelog

See http://forge.typo3.org/projects/activity/extension-piwikintegration for the current Activity and Changelog

Known Problems

FIXED There is a know incompatibility with t3editor in TYPO3 4.2, it works in TYPO3 4.3RC1.

See http://forge.typo3.org/projects/extension-piwikintegration/issues for more details.