Knowledge Base

How to use Piwik with PrestaShop

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

Using Piwik with PrestaShop

Piwik gathers detailed statistics about visitor traffic to your site. There are several modules available for PrestaShop that provide Piwik integration, but Piwik's own site recommends the Piwik module for PrestaShop.

Before you can use Piwik with PrestaShop, 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.

To install and configure the Piwik module for PrestaShop, follow these steps:

  1. Use your web browser to visit https://github.com/cmjnisse/piwikanalyticsjs-prestashop/releases.
  2. Under Downloads, click piwikanalyticsjs.zip, and then save the .zip file on your computer.
  3. Log in to your PrestaShop site as the administrator.
  4. On the left-hand menu bar, click Modules and Services.
  5. Click Add a new module.
  6. Click Browse, select the .zip file you downloaded in step 2, and then click Upload this module.
  7. Under MODULES LIST, locate Piwik Analytics, and then click Install.
  8. Click Proceed with the installation. After PrestaShop finishes installing the module, the Piwik Analytics configuration page appears:
    • In the Piwik Host text box, type the URL to your Piwik installation.
      Do not add http://. For example, if your domain name is example.com, and Piwik is installed in the piwik directory, type example.com/piwik.
    • In the Piwik site id text box, type the Piwik ID number for your site.
      To obtain the Piwik ID number for your site, follow these steps:
      1. Log in to Piwik.
      2. On the top right of the page, click All Websites. The All Websites dashboard page appears.
      3. In the WEBSITE column, click the name of the website that you want to track.
      4. In the browser address bar, look for the idSite= string. The number following the idSite= string is the Piwik site ID number. For example, in the following URL the site ID number is 3:
        http://example.com/piwik/index.php?module=CoreHome&action=index&date=yesterday&period=day&idSite=3
        
    • In the Piwik token auth text box, type your Piwik authentication token.

      To obtain your Piwik authentication token, follow these steps:

      1. Log in to Piwik.
      2. On the top right of the page, click your administrator username.
      3. On the left menu bar, under Platform, click API.
      4. Under User authentication, copy the long alphanumeric string. This is your Piwik authentication token. (Do not copy the &token_auth= portion.)
    • Under PIWIK ANALYTICS ADVANCED - EDIT PIWIK SITE, in the Ecommerce option box, click YES.
  9. Click Save. Piwik is now enabled for PrestaShop. To view site statistics, log in to your Piwik account.

More Information

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