Simple library to generate Matomo tracker urls that you can use to insert tracking images in your site.
It's compatible with PSR-7 ServerRequestInterfaces
- PHP >= 7.0
This package is installable and autoloadable via Composer as oscarotero/matomo-tracker.
composer require oscarotero/matomo-tracker
use MatomoTracker\Url;
$url = Url::createFromServerRequest($serverRequest, 'https://analytics.example.com/piwik.php', 1);
$url->title('Page title')
->userId($user->getId());
echo sprintf('<img src="%s">', (string) $url);
Please see CHANGELOG for more information about recent changes.
The MIT License (MIT). Please see LICENSE for more information.