Need help with matomo-php-tracker?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

matomo-org
154 Stars 71 Forks BSD 3-Clause "New" or "Revised" License 144 Commits 11 Opened issues

Description

PHP Client for Matomo Analytics Tracking API

Services available

!
?

Need anything else?

Contributors list

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 (jsondecode, jsonencode)
  • 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

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.