Skip to content

Integrates Matomo (former piwik) analytics into the Admin

License

Notifications You must be signed in to change notification settings

luyadev/luya-module-matomo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LUYA Logo

Matomo (Piwik) Module

LUYA Latest Stable Version Total Downloads Slack Support

Provide TrackingCode implementation Widget and Admin-Dashboard object to see latest visits from Matomo (former Piwik).

LUYA Logo

Installation

For the installation of modules Composer is required.

composer require luyadev/luya-module-matomo

In order to add the modules to your project go into the modules section of your config:

'modules' => [
    // ...
    'matomoadmin' => [
        'class' => 'luya\matomo\Module',
         'serverUrl' => 'https://matomo.example.com', // without trailing slash, use full schema path.
         'siteId' => 1,
         'apiToken' => 'THE_API_TOKEN',
    ]
]
  • serverUrl: the URL which points to the Matomo installation
  • siteId: get the site Id in the Matomo dashboard under Settings > Websites > Manage
  • apiToken: get the Matomo API token under Settings > Platform > API > User authentication

Usage

After configure the admin module you can now integrate the TrackingCode widget. The tracking code will register the javascript tracking and as fall back also the tracking image between noscript tags.

We reccommend to integrate the TrackingCodeWidget right before the endBody() function in the layout.

<?= \luya\matomo\TrackingCodeWidget::widget(); ?>
<?php $this->endBody() ?>