Login / Status
developer.Resource
Home . Documentation . Document Library . Extension Manuals
Sponsors
hosted by punkt.deTYPO3 and Open Source Magazine

1.3. Configuration

All configuration parameters for this extension should be in your template TypoScript, inside the config.tx_bn1piwik container. Please see the option descriptions below.

Required  parameters

Defines your Piwik site id and host/path to your piwik installation. This parameter needs to be set for the extension to work. If your Sites ID is 3 and the path your piwik installation is stats.myhost.rl/piwik/piwik.php, your TypoScript in the template should look like:

config.tx_piwik {

      piwik_idsite = 3

piwik_host   = http://stats.myhost.rl/piwik/

}

Once you set up this parameter, you can check if everything worked correctly by looking at your pages HTML source. The piece of code that drives Piwik is inserted right before the closing tag of <body> container:

<!-- Start B-Net1 Piwik Tag →<script language="javascript" src="http://stats.myhost.rl/piwik/piwik.js" type="text/javascript"></script><script type="text/javascript"><!--try {var piwikTracker = Piwik.getTracker("http://stats.myhost.rl/piwik/piwik.php", 3);piwikTracker.enableLinkTracking();piwikTracker.trackPageView();} catch( err ) {}//--></script><noscript><p><img src="http://stats.myhost.rl/piwik/piwik.php?idsite=3" style="border:0" alt="piwik"/></p></noscript><!-- End B-Net1 Piwik Tag →</body>

Configuration Options

The following table shows you all configuration options for the Piwik JavaScript API. All these parameters you have to set in  your TypoScript Template like the required parameters piwik_idsite and piwik_host.

Property:

Data type:

Description:

Default:

piwik_idsite

string

The id of your Piwik account

piwik_host

string

The host / path to your piwik installation without URL-scheme

actionName

string / stdWrap

This parameter controll the action name, which will be tracked by Piwik. This parameter has one special keyword:

“TYPO3” this means, that the page title will be used for this parameter.

All other values will be rendered directly to this JavaScript variable. If you want to use other JavaScript objects like document.title you can do so. If you want to overwrite the parameter with an static string, like from TS, you have to quote the value with single quotes.

This extension will not quote the value of this parameter.

Empty string

trackGoal

int

ID of the goal to be triggered

setDownloadExtensions

string

A list of file extensions, divided by a pipe symbol (|).

7z|aac|avi|csv|doc|exe|flv|gif|gz|jpe?g|js|mp(3|4|e?g)|mov|pdf|phps|png|ppt|rar|sit|tar|torrent|txt|wma|wmv|xls|xml|zip

addDownloadExtensions

string

A list of file extensions, divided by a pipe symbol (|).

7z|aac|avi|csv|doc|exe|flv|gif|gz|jpe?g|js|mp(3|4|e?g)|mov|pdf|phps|png|ppt|rar|sit|tar|torrent|txt|wma|wmv|xls|xml|zip

setDomains

string / list

A comma separated list of host aliases for your site.

By default all links to domains other than the current domain are considered outlinks. If you have multiple domains and don’t want to consider links to these websites as “outlinks” you can add this new javascript variable.

setLinkTrackingTimer

int

When a user clicks to download a file, or when he clicks on an outbound link, Piwik records it: it adds a small delay before the user is redirected to the requested file or link. We use a default value of 500ms, but you can set it shorter, with the risk that this time is not long enough to record the data in Piwik.

500

enableLinkTracking

boolean

To disable all the automatic downloads and outlinks tracking, you must set this parameter to 0

1

setIgnoreClasses

string

You can disable automatic download and outlink tracking for links with this CSS classes.

setDownloadClasses

string

If you want Piwik to consider a given link as a download, you can add the 'piwik_download' css class to the link.

With this parameter you can customize and rename the CSS class used to force a click to being recorded as a download

setLinkClasses

string

If you want Piwik to consider a given link as an outlink (links to the current domain or to one of the alias domains), you can add the 'piwik_link' css class to the link.

With this parameter you can customize and rename the CSS class used to force a click to being recorded as an outlink.

[TS-Setup: config.tx_bn1piwik]

TypoScript Examples

Using the stdWrap feature of the “actionName” property, to build a actionName hierarchy like a rootline navigation.

config.tx_piwik {

piwik_idsite = 3

piwik_host   = http://stats.myhost.rl/piwik/

actionName= TYPO3

actionName {

stdWrap {

cObject = HMENU

cObject {

special=rootline

special.range= 1 | -1

includeNotInMenu = 1

wrap = |/index

1=TMENU

1.itemArrayProcFunc = user_UrteileItemArrayProcFunc

1.NO.allWrap=  |   /   |*| |   /   |*| |

1.NO.doNotLinkIt = 1

}

}

}

}