Markus Michalski FAQ

Matomo Analytics: Installation and Operation

Matomo Analytics for Sylius - installation via Composer (Packeton), setup command, update, cron jobs and uninstall in the correct order

Deutsche Version

Back to overview

Matomo Analytics: Installation and Operation

This documentation always describes the latest published version.

Installation

Note: The plugin is private and managed through Packeton (https://packeton.markus-michalski.net). You receive the credentials after purchasing the license.

1. Install the package

Add the Packeton repository to your shop's composer.json:

{ "repositories": [{ "type": "composer", "url": "https://packeton.markus-michalski.net" }] }
composer require mmd/sylius-matomo-integration-plugin

2. Register the bundle

In config/bundles.php:

Mmd\SyliusMatomoIntegrationPlugin\MmdSyliusMatomoIntegrationPlugin::class => ['all' => true],

3. Import the admin routes

Create the file config/routes/mmd_sylius_matomo_integration.yaml:

mmd_sylius_matomo_integration_admin:
    resource: "@MmdSyliusMatomoIntegrationPlugin/config/routes/admin.yaml"

The storefront needs no routes of its own, the plugin defines none for it. The bundle registers the admin grid, the Twig hooks, the Shop API resource and the Doctrine mapping itself.

4. Run the setup command

bin/console mmd:matomo-integration:setup

The command creates the table mmd_sylius_matomo_channel_settings. It behaves as follows:

bin/console doctrine:migrations:migrate works as well. It runs all open migrations of your project, though, while the setup command only runs those of this plugin.

The migration only runs on MySQL 8 and MariaDB and aborts on other databases. Do not install the plugin in a project that runs on PostgreSQL or SQLite.

5. Set up a channel

Nothing is active after installation: a new entry is switched off. Open MMKreativ Plugins > Matomo Analytics in the admin and set up your first channel, see Configuration.

Update

composer update mmd/sylius-matomo-integration-plugin
bin/console mmd:matomo-integration:setup
bin/console cache:clear

The setup command is idempotent and only runs new migrations. The admin shows the installed version in the header of the Matomo Analytics page.

Cron jobs

The plugin needs no cron jobs and ships no commands that you have to run regularly.

Uninstall

Keep this order, because the migration can only be rolled back while the bundle is still registered:

  1. Remove the table while the bundle is still registered:

    bin/console doctrine:migrations:execute --down 'Mmd\SyliusMatomoIntegrationPlugin\Migrations\Version20261004100000'
    
  2. Delete the file config/routes/mmd_sylius_matomo_integration.yaml and remove the bundle line from config/bundles.php.

  3. Remove the package:

    composer remove mmd/sylius-matomo-integration-plugin
    

The plugin creates no templates in your project that you would have to remove separately. A Klaro service created by the plugin stays in the Klaro plugin's catalog. Remove it in the Klaro admin if you want to.