2017 © Pedro Peláez
 

symfony-bundle matomo-bundle

This bundle provides a block service for using Matomo inside the sonata-project.

image

core23/matomo-bundle

This bundle provides a block service for using Matomo inside the sonata-project.

  • Sunday, July 15, 2018
  • by core23
  • Repository
  • 0 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

NucleosMatomoBundle

Latest Stable Version Latest Unstable Version License, (*1)

Total Downloads Monthly Downloads Daily Downloads, (*2)

Continuous Integration Code Coverage Type Coverage, (*3)

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

Installation

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

composer require nucleos/matomo-bundle
# To define a default http client and message factory
composer require symfony/http-client nyholm/psr7

Enable the Bundle

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

// config/bundles.php

return [
    // ...
    Nucleos\MatomoBundle\NucleosMatomoBundle::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., (*7)

You can use npm or yarn to load the library:, (*8)

Usage

Define a http client in your configuration., (*9)

# config/packages/nucleos_matomo.yaml

nucleos_matomo:
    http:
        client: 'httplug.client'
        message_factory: 'nyholm.psr7.psr17_factory'

Render tracking code

{{ sonata_block_render({ 'type': 'nucleos_matomo.block.tracker' }, {
    'host': 'http://matomo.example.com',
    'site': 1
}) }}

Render statistic graph

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

License

This bundle is under the MIT license., (*10)

The Versions