No description
Find a file
Daniel Baumann 2d08ca6ea9
Releasing fastforward version 3.3.2-2~ffwd13+u1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
2026-02-13 06:18:23 +01:00
.github/workflows Adding upstream version 3.3.2. 2026-02-13 06:17:28 +01:00
debian Releasing fastforward version 3.3.2-2~ffwd13+u1. 2026-02-13 06:18:23 +01:00
tests/Unit Adding upstream version 3.3.2. 2026-02-13 06:17:28 +01:00
.gitattributes Adding upstream version 3.3.2. 2026-02-13 06:17:28 +01:00
.gitignore Adding upstream version 3.3.2. 2026-02-13 06:17:28 +01:00
CHANGELOG.md Adding upstream version 3.3.2. 2026-02-13 06:17:28 +01:00
composer.json Adding upstream version 3.3.2. 2026-02-13 06:17:28 +01:00
LICENSE Adding upstream version 3.3.2. 2026-02-13 06:17:28 +01:00
MatomoTracker.php Adding upstream version 3.3.2. 2026-02-13 06:17:28 +01:00
phpunit.xml.dist Adding upstream version 3.3.2. 2026-02-13 06:17:28 +01:00
PiwikTracker.php Adding upstream version 3.3.2. 2026-02-13 06:17:28 +01:00
README.md Adding upstream version 3.3.2. 2026-02-13 06:17:28 +01:00
run_tests.sh Adding upstream version 3.3.2. 2026-02-13 06:17:28 +01:00

PHP Client for Matomo Analytics Tracking API

The PHP Tracker Client provides all features of the Matomo Javascript Tracker, such as Ecommerce Tracking, Custom Variables, Event Tracking and more.

Documentation and examples

Check out our Matomo-PHP-Tracker developer documentation and Matomo Tracking API guide.

// Required variables
$matomoSiteId = 6;                  // Site ID
$matomoUrl = "https://example.tld"; // Your matomo URL
$matomoToken = "";                  // Your authentication token

// Optional variable
$matomoPageTitle = "";              // The title of the page

// Load object
require_once("MatomoTracker.php");

// Matomo object
$matomoTracker = new MatomoTracker((int)$matomoSiteId, $matomoUrl);

// Set authentication token
$matomoTracker->setTokenAuth($matomoToken);

// Track page view
$matomoTracker->doTrackPageView($matomoPageTitle);

Requirements:

  • JSON extension (json_decode, json_encode)
  • cURL or stream extension (to issue the HTTPS request to Matomo)

Installation

Composer

composer require matomo/matomo-php-tracker

Manually

Alternatively, you can download the files and require the Matomo tracker manually:

require_once("MatomoTracker.php");

License

Released under the BSD License