Configuring Yireo Piwik for Joomla!

Our Yireo Piwik plugin allows you to integrate the Piwik API in Joomla!, but not using it's common JavaScript API but using a HTTP API instead. This tutorial shows you how to configure things and how to troubleshoot your environment if things do not work correctly.

About the Piwik HTTP API

Most people integrate Piwik using its JavaScript calls, but this has some downsides: Additional JavaScript needs to be loaded by any client visiting your site, which slows down the user experience. And new EU cookie laws simply prevent you from doing this, unless you explicitely ask for their consent. The HTTP-based API bypasses both problems.

The HTTP API makes a connection from the Joomla! application directly to the Piwik application. It accesses the Piwik application in a similar way as the browser normally would. To do this, our plugin calls upon a Piwik client-class which again sets up the connection using CURL. For our plugin to work, PHP CURL support is required.

Installing and configuring our plugiin

To get started, download the plugin from our site and install it in Joomla! using the Joomla! Extension Manager. After this, go to the Plugin Manager and enable this plugin. Within the plugin parameters, make sure to configure the following settings:

  • Site ID: A numeric value found on the Websites-tab in Piwik
  • Piwik URL: The base URL of your Piwik application
  • API-token: A secret-word found under the API-page in Piwik

Troubleshooting things

If Piwik makes no mentioning of traffic being logged, you need to troubleshoot your hosting environment. Note that you can prevent certain IP-addresses from being logged by Piwik. When debugging things, it is best to keep that setting empty.

 When Joomla! sets up the network-connection to Piwik various things need to be working:

  • PHP-support for CURL needs to be present
  • If Joomla! and Piwik are installed on the same server, the internal firewall needs to allow traffic from the local Joomla! to the local Piwik site. Some hosting environments have a buggy firewall-setup that causes problems here.
  • If Joomla! and Piwik are installed on the same server, the hostname used for Piwik needs to be resolving correctly. Some hosting environments use different DNS-settings for external lookups than for internal lookups, which is simply wrong.

If you experience problems with the above, this can be solved only by the hosting provider. If you're not able to check for these things yourself, you need to contact your hosting provider to do these checks for you.