Skip to content
Service class to use the Piwik API
PHP
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
library/Zend/Service
tests
README.md

README.md

Zend_Service_Piwik

Synopsis:

Use the Zend_Service_Piwik-component to query your Piwik-Installation via the API.

Basic usage:

$piwik = new Zend_Service_Piwik();
$piwik->setHost('http://demo.piwik.org')
      ->setAuthToken('anonymous')
      ->setIdSite(7)
      ->setFormat(Zend_Service_Piwik::FORMAT_JSON)
      ->setDate('previous7');

$pageTitles = $piwik->Actions()->getPageTitles();

echo $pageTitles;

$pageTitles contains the relevant information and can be processed further if needed.

Configuration using Zend_Config

Alternativly you can pass an Zend_Config-object to set the options.

[piwik]
host = 'http://demo.piwik.org'
tokenauth = 'anonymous'
idsite = 7
format = 'json'
date = 'previous7'
$configFile = '/path/to/ini';
$config = new Zend_Config_Ini($configFile, 'piwik');

$piwik = new Zend_Service_Piwik($config);
Something went wrong with that request. Please try again.