Knowledge Base

How to use Piwik with Joomla

This article describes how to integrate the open-source Piwik analytics platform with Joomla.

Using Piwik with Joomla

Piwik gathers detailed statistics about visitor traffic to your site. You can integrate Piwik with Joomla using either of the following methods:

  • Installing and configuring a Joomla extension.
  • Editing the Joomla template directly.

The following sections describe how to do both of these methods.

Before you can use Piwik with Joomla, you must first install the Piwik application files. There are two ways to do this:

  • If your hosting account includes Softaculous, you can use it to install Piwik.
  • If your hosting account does not include Softaculous, or if you want to install the newest version, you can install Piwik manually.
Method #1: Use an extension

There are several extensions available for Joomla that provide Piwik integration, but Piwik's own site recommends nfrPiwik. To install and configure the nfrPiwik extension on your Joomla site, follow these steps:

  1. Log in to your Piwik account as the administrator:
    • On the top right of the page, click your administrator username.
    • Under Manage, click Tracking Code.
    • Under JavaScript Tracking Code, copy the entire text in the tracking code box, including the starting <!—Piwik—> tag and the ending <!—End Piwik Code—> tag.
  2. Use your web browser to visit http://extensions.joomla.org/extensions/extension/site-management/analytics/nfrpiwik.
  3. In the right sidebar, click Download.
  4. On the nfrtest.de site, under Plugins, locate the correct file for your Joomla version, click Download, and then save the .zip file on your local computer.
  5. Log in to your Joomla site as the administrator.
  6. On the top menu bar, click Extensions, and then click Extension Manager.
  7. Click the Upload Package File tab.
  8. Click Browse, and then select the .zip file you downloaded in step 4.
  9. Click Upload & Install. Joomla installs the extension.
  10. On the top menu bar, click Extensions, and then click Plugin Manager.
  11. Under Filter, in the Select Type list box, click system.
  12. Locate the System - nfrPiwik plugin in the Plugin Name column.
  13. In the Status column, click the x icon to enable the plugin. The extension is now installed and activated.
  14. In the Plugin Name column, click System - nfrPiwik.
  15. In the Inputbox for tracking code text box, paste the tracking code snippet that you obtained in step 1.
  16. Click Save, and then reload your site in a web browser. Examine the page source code to verify that the Piwik tracking code is loaded. To view site statistics, log in to your Piwik account.
Method #2: Edit the template

Extensions are convenient, but they also carry processing overhead with them that may affect site performance. If you prefer not to use an extension, you can edit the Joomla template directly.

To enable Piwik by editing the template, follow these steps:

  1. Log in to your Piwik account as the administrator:
    • On the top right of the page, click your administrator username.
    • Under Manage, click Tracking Code.
    • Under JavaScript Tracking Code, copy the entire text in the tracking code box, including the starting <!—Piwik—> tag and the ending <!—End Piwik Code—> tag.
  2. Log in to Joomla as the administrator.
  3. On the top menu bar, click Extensions, and then click Template Manager.
  4. Select the template you want to modify, and then paste the tracking code snippet that you obtained in step 1.
  5. Save your changes to the template, and then reload your site in a web browser. Examine the page source code to verify that the Piwik tracking code is loaded. To view site statistics, log in to your Piwik account.

More Information

For more information about Piwik, please visit https://piwik.org.