2017 © Pedro PelĂĄez
 

silverstripe-vendormodule silverstripe-piwik

Adds piwik tracking code to your site

image

wernerkrauss/silverstripe-piwik

Adds piwik tracking code to your site

  • Monday, January 15, 2018
  • by wernerkrauss
  • Repository
  • 1 Watchers
  • 4 Stars
  • 570 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 2 Open issues
  • 6 Versions
  • 22 % Grown

The README.md

Silverstripe Piwik Analytics Module

Scrutinizer Code Quality, (*1)

This module includes a piwik analytics javascript at the bottom of your page., (*2)

It's configurable via config API, you can change the included Javascript by overwriting the Piwik.ss template., (*3)

Requirements

  • Silverstripe > 4.0

For a SS3 compatible version use version 0.2., (*4)

Installation

Best installed via composer. You may clone the repo or download the zip, however you should find a directory called "silverstripe-piwik" with all files in vendor/wernerkrauss/, (*5)

using Composer

composer require wernerkrauss/silverstripe-piwik ^0.4.0

Features

  • Includes piwik tracking code to your page. You can configure if it's included automatically or manually by calling $Piwik inside your template
  • By default only included in frontend pages
  • By default only included in Live mode

Configuration

Netwerkstatt\Piwik\Extensions\PiwikExtension:
  piwik_server: '//logs.example.com/' #domain without protocol an trailing slash
  piwik_site_id: 123 #the id defined by your piwik install
  show_on_dev: false #default: don't show in dev mode
  show_on_test: false #default: don't show in test mode
  show_on_live: true #default: show in live mode
  auto_include: true #default: include automatically
  include_in_backend: false #default: don't include in backend

Usage with Subsites Module

When you're using subsites you can add the PIWIK Site ID for each subsite / domain in SiteConfig. To do this you have to add an extension:, (*6)

SilverStripe\SiteConfig\SiteConfig:
  extensions:
    - Netwerkstatt\Piwik\Extensions\PiwikSiteConfigExtension

You'll also have to tweak the used template for the tracking code. Copy the default Piwik.ss file to your theme's /templates/ folder or to /mysite/templates/ and adjust the setting like, (*7)

_paq.push(["setSiteId", "$SiteConfig.PiwikSiteID"]);

Exclude on some controllers

You can finetune the controllers Piwik should NOT be included using the PiwikExtension.excluded_controllers config var. By default the module is disabled on dev/build., (*8)

Usage with Subsites and Translatable

When you're useing Subsites with translatable you have to be sure to add it to the SiteConfig for every translation. One workaround might be if don't put the value fot the Piwik SiteID to SiteConfig, but directly to the Subsites DataObject., (*9)

Then don't extend SiteConfig but Subsite:, (*10)

Silverstripe\Subsites\Model\Subsite:
  extensions:
    - Netwerkstatt\Piwik\Extensions\PiwikSiteConfigExtension

and change your template to reflect the changes:, (*11)

_paq.push(["setSiteId", "$SiteConfig.Subsite.PiwikSiteID"]);

The Versions

15/01 2018

dev-master

9999999-dev

Adds piwik tracking code to your site

  Sources   Download

MIT

The Requires

 

extension silverstripe

15/01 2018

dev-vendormodule

dev-vendormodule

Adds piwik tracking code to your site

  Sources   Download

MIT

The Requires

 

extension silverstripe

15/01 2018

0.4.0

0.4.0.0

Adds piwik tracking code to your site

  Sources   Download

MIT

The Requires

 

extension silverstripe

01/06 2017

0.3.0

0.3.0.0

Adds piwik tracking code to your site

  Sources   Download

MIT

The Requires

 

extension silverstripe

16/03 2016

0.2.0

0.2.0.0

Adds piwik tracking code to your site

  Sources   Download

MIT

The Requires

 

extension silverstripe

04/01 2016

0.1.0

0.1.0.0

Adds piwik tracking code to your site

  Sources   Download

MIT

The Requires

 

extension silverstripe