2017 © Pedro Peláez
 

magento2-module module-piwik

Piwik analytics module for Magento 2

image

henhed/module-piwik

Piwik analytics module for Magento 2

  • Sunday, May 6, 2018
  • by henhed
  • Repository
  • 6 Watchers
  • 23 Stars
  • 5,315 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 14 Forks
  • 1 Open issues
  • 20 Versions
  • 51 % Grown

The README.md

Matomo Integration for Magento 2

Chessio_Matomo is a Matomo web analytics module for the Magento 2 eCommerce platform. Matomo is an extensible free/libre analytics tool that can be self-hosted, giving you complete data ownership. Chessio_Matomo lets you integrate Matomo with your Magento 2 store front., (*1)

This module is the successor of Henhed_Piwik and thus continues with its semantic versioning, beginning with version v2.1.0 . If you're using a Magento version prior to 2.2, you'll need to stick to the 1.x releases of the original Henhed_Piwik. For manual installation, check out the Releases archive. For installation using Composer, you can use the tilde or caret version constraint operators (e.g. ~1.3 or ^1.3.1)., (*2)

Installation

To install Chessio_Matomo, download and extract the main zip archive and move the extracted folder to app/code/Chessio/Matomo in your Magento 2 installation directory., (*3)

unzip magento2-matomo-main.zip
mkdir app/code/Chessio
mv magento2-matomo-main app/code/Chessio/Matomo

Alternatively, you can clone the Chessio_Matomo Git repository into app/code/Chessio_Matomo., (*4)

git clone https://github.com/fnogatz/magento2-matomo.git app/code/Chessio/Matomo

Or, if you prefer, install it using Composer., (*5)

composer require chessio/module-matomo

Finally, enable the module with the Magento CLI tool., (*6)

php bin/magento module:enable Chessio_Matomo --clear-static-content

Configuration

Once installed, configuration options can be found in the Magento 2 administration panel under Stores/Configuration/Sales/Matomo API. To start tracking, set Enable Tracking to Yes, enter the Hostname of your Matomo installation and click Save Config. If you have multiple websites in the same Matomo installation, make sure the Site ID configured in Magento is correct., (*7)

Customization

If you need to send some custom information to your Matomo server, Chessio_Matomo lets you do so using event observers., (*8)

To set custom data on each page, use the matomo_track_page_view_before event. A tracker instance will be passed along with the event object to your observer's execute method., (*9)

public function execute(\Magento\Framework\Event\Observer $observer)
{
    $tracker = $observer->getEvent()->getTracker();
    /** @var \Chessio\Matomo\Model\Tracker $tracker */
    $tracker->setDocumentTitle('My Custom Title');
}

If you only want to add data under some specific circumstance, find a suitable event and request the tracker singleton in your observer's constructor. Store the tracker in a class member variable for later use in the execute method., (*10)

public function __construct(\Chessio\Matomo\Model\Tracker $matomoTracker)
{
    $this->_matomoTracker = $matomoTracker;
}

Beware of tracking user specific information on the server side as it will most likely cause caching problems. Instead, use Javascript to retrieve the user data from a cookie, localStorage or some Ajax request and then push the data to Matomo using either the Chessio_Matomo JS component..., (*11)

require(['Chessio_Matomo/js/tracker'], function (trackerComponent) {
    trackerComponent.getTracker().done(function (tracker) {
        // Do something with tracker
    });
});

... or the vanilla Matomo approach:, (*12)

var _paq = _paq || [];
_paq.push(['setDocumentTitle', 'My Custom Title']);

See the Matomo Developer Docs or the \Chessio\Matomo\Model\Tracker source code for a list of all methods available in the Tracking API., (*13)

The Versions

06/05 2018

dev-master

9999999-dev

Piwik analytics module for Magento 2

  Sources   Download

AGPL-3.0+

The Requires

  • magento/framework ~101.0
  • magento/module-catalog ~102.0
  • magento/module-catalog-search ~100.0
  • magento/module-checkout ~100.0
  • magento/module-config ~101.0
  • magento/module-customer ~101.0
  • magento/module-quote ~101.0
  • magento/module-sales ~101.0
  • magento/module-search ~100.0
  • magento/module-store ~100.0
  • php ~7.0.0|~7.1.0

 

06/05 2018

v2.0.2

2.0.2.0

Piwik analytics module for Magento 2

  Sources   Download

AGPL-3.0+

The Requires

  • magento/framework ~101.0
  • magento/module-catalog ~102.0
  • magento/module-catalog-search ~100.0
  • magento/module-checkout ~100.0
  • magento/module-config ~101.0
  • magento/module-customer ~101.0
  • magento/module-quote ~101.0
  • magento/module-sales ~101.0
  • magento/module-search ~100.0
  • magento/module-store ~100.0
  • php ~7.0.0|~7.1.0

 

06/05 2018

2.0.2.x-dev

2.0.2.9999999-dev

Piwik analytics module for Magento 2

  Sources   Download

AGPL-3.0+

The Requires

  • magento/framework ~101.0
  • magento/module-catalog ~102.0
  • magento/module-catalog-search ~100.0
  • magento/module-checkout ~100.0
  • magento/module-config ~101.0
  • magento/module-customer ~101.0
  • magento/module-quote ~101.0
  • magento/module-sales ~101.0
  • magento/module-search ~100.0
  • magento/module-store ~100.0
  • php ~7.0.0|~7.1.0

 

27/03 2018

v2.0.1

2.0.1.0

Piwik analytics module for Magento 2

  Sources   Download

AGPL-3.0+

The Requires

  • magento/framework ~101.0
  • magento/module-catalog ~102.0
  • magento/module-catalog-search ~100.0
  • magento/module-checkout ~100.0
  • magento/module-config ~101.0
  • magento/module-customer ~101.0
  • magento/module-quote ~101.0
  • magento/module-sales ~101.0
  • magento/module-search ~100.0
  • magento/module-store ~100.0
  • php ~7.0.0|~7.1.0

 

27/03 2018

2.0.1.x-dev

2.0.1.9999999-dev

Piwik analytics module for Magento 2

  Sources   Download

AGPL-3.0+

The Requires

  • magento/framework ~101.0
  • magento/module-catalog ~102.0
  • magento/module-catalog-search ~100.0
  • magento/module-checkout ~100.0
  • magento/module-config ~101.0
  • magento/module-customer ~101.0
  • magento/module-quote ~101.0
  • magento/module-sales ~101.0
  • magento/module-search ~100.0
  • magento/module-store ~100.0
  • php ~7.0.0|~7.1.0

 

28/01 2018

v2.0.0

2.0.0.0

Piwik analytics module for Magento 2

  Sources   Download

AGPL-3.0+

The Requires

  • magento/framework ~101.0
  • magento/module-catalog ~102.0
  • magento/module-catalog-search ~100.0
  • magento/module-checkout ~100.0
  • magento/module-config ~101.0
  • magento/module-customer ~101.0
  • magento/module-quote ~101.0
  • magento/module-sales ~101.0
  • magento/module-search ~100.0
  • magento/module-store ~100.0
  • php ~7.0.0|~7.1.0

 

28/01 2018

2.0.0.x-dev

2.0.0.9999999-dev

Piwik analytics module for Magento 2

  Sources   Download

AGPL-3.0+

The Requires

  • magento/framework ~101.0
  • magento/module-catalog ~102.0
  • magento/module-catalog-search ~100.0
  • magento/module-checkout ~100.0
  • magento/module-config ~101.0
  • magento/module-customer ~101.0
  • magento/module-quote ~101.0
  • magento/module-sales ~101.0
  • magento/module-search ~100.0
  • magento/module-store ~100.0
  • php ~7.0.0|~7.1.0

 

22/10 2017

v1.3.1

1.3.1.0

Piwik analytics module for Magento 2

  Sources   Download

AGPL-3.0+

The Requires

  • php ~5.5.0|~5.6.0|~7.0.0|~7.1.0

 

21/10 2017

1.3.1.x-dev

1.3.1.9999999-dev

Piwik analytics module for Magento 2

  Sources   Download

AGPL-3.0+

The Requires

  • php ~5.5.0|~5.6.0|~7.0.0|~7.1.0

 

02/03 2017

v1.3.0

1.3.0.0

Piwik analytics module for Magento 2

  Sources   Download

AGPL-3.0+

The Requires

  • php ~5.5.0|~5.6.0|~7.0.0

 

28/02 2017

1.3.0.x-dev

1.3.0.9999999-dev

Piwik analytics module for Magento 2

  Sources   Download

AGPL-3.0+

The Requires

  • php ~5.5.0|~5.6.0|~7.0.0

 

20/11 2016

dev-custom-variables

dev-custom-variables

Piwik analytics module for Magento 2

  Sources   Download

AGPL-3.0+

The Requires

  • php ~5.5.0|~5.6.0|~7.0.0

 

17/11 2016

v1.2.1

1.2.1.0

Piwik analytics module for Magento 2

  Sources   Download

AGPL-3.0+

The Requires

  • php ~5.5.0|~5.6.0|~7.0.0

 

17/11 2016

1.2.1.x-dev

1.2.1.9999999-dev

Piwik analytics module for Magento 2

  Sources   Download

AGPL-3.0+

The Requires

  • php ~5.5.0|~5.6.0|~7.0.0

 

07/11 2016

v1.2.0

1.2.0.0

Piwik analytics module for Magento 2

  Sources   Download

AGPL-3.0+

The Requires

  • php ~5.5.0|~5.6.0|~7.0.0

 

30/10 2016

1.2.0.x-dev

1.2.0.9999999-dev

Piwik analytics module for Magento 2

  Sources   Download

AGPL-3.0+

The Requires

  • php ~5.5.0|~5.6.0|~7.0.0

 

25/02 2016

v1.1.0

1.1.0.0

Piwik analytics module for Magento 2

  Sources   Download

AGPL-3.0+

The Requires

  • php ~5.5.0|~5.6.0|~7.0.0

 

25/02 2016

1.1.0.x-dev

1.1.0.9999999-dev

Piwik analytics module for Magento 2

  Sources   Download

AGPL-3.0+

The Requires

  • php ~5.5.0|~5.6.0|~7.0.0

 

08/02 2016

1.0.1.x-dev

1.0.1.9999999-dev

Piwik analytics module for Magento 2

  Sources   Download

AGPL-3.0+

The Requires

  • php ~5.5.0|~5.6.0|~7.0.0

 

08/02 2016

v1.0.1

1.0.1.0

Piwik analytics module for Magento 2

  Sources   Download

AGPL-3.0+

The Requires

  • php ~5.5.0|~5.6.0|~7.0.0