Skip to content
This bundle provides a block service for using Matomo (Piwik) inside the sonata-project.
PHP HTML JavaScript Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
assets
src
tests
vendor-bin
.editorconfig
.gitattributes
.gitignore
.kodiak.toml
.php_cs.dist
.rmt.yml
.travis.yml
CHANGELOG
LICENSE.md
Makefile
README.md
composer.json
package.json
phpstan.neon.dist
phpunit.xml.dist

README.md

MatomoBundle

Latest Stable Version Latest Unstable Version License

Total Downloads Monthly Downloads Daily Downloads

Build Status Scrutinizer Code Quality Code Climate Coverage Status

This bundle provides a wrapper for using the matomo (Piwik) statistic inside the symfony sonata-project.

Installation

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

composer require core23/matomo-bundle
composer require php-http/guzzle6-adapter # if you want to use Guzzle

Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in config/bundles.php file of your project:

// config/bundles.php

return [
    // ...
    Http\HttplugBundle\HttplugBundle::class     => ['all' => true],
    Core23\MatomoBundle\Core23MatomoBundle::class => ['all' => true],
];

Assets

It is recommended to use webpack / webpack-encore to include the MatomoTable.js file in your page. These file is located in the assets folder.

You can use npm or yarn to load the library:

Usage

Define a HTTPlug client in your configuration.

# config/packages/httplug.yaml

httplug:
    classes:
        client: Http\Adapter\Guzzle6\Client
        message_factory: Http\Message\MessageFactory\GuzzleMessageFactory
        uri_factory: Http\Message\UriFactory\GuzzleUriFactory
        stream_factory: Http\Message\StreamFactory\GuzzleStreamFactory
{# template.twig #}

{{ sonata_block_render({ 'type': 'core23_matomo.block.statistic' }, {
    'host': 'http://matomo.example.com',
    'site': 1,
    'token': 'MATOMO_API_TOKEN'
}) }}

License

This bundle is under the MIT license.

You can’t perform that action at this time.