PHPackages                             matomo/matomo-php-tracker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. matomo/matomo-php-tracker

ActiveLibrary

matomo/matomo-php-tracker
=========================

PHP Client for Matomo Analytics Tracking API

3.4.0(4mo ago)2213.1M↓21.7%83[7 issues](https://github.com/matomo-org/matomo-php-tracker/issues)[3 PRs](https://github.com/matomo-org/matomo-php-tracker/pulls)14BSD-3-ClausePHPPHP ~7.2 || ~7.3 || ~7.4 || ~8.0 || ~8.1 || ~8.2 || ~8.3 || ~8.4 || ~8.5CI passing

Since Dec 18Pushed 3mo ago23 watchersCompare

[ Source](https://github.com/matomo-org/matomo-php-tracker)[ Packagist](https://packagist.org/packages/matomo/matomo-php-tracker)[ Docs](https://matomo.org)[ RSS](/packages/matomo-matomo-php-tracker/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (36)Used By (14)

PHP Client for Matomo Analytics Tracking API
============================================

[](#php-client-for-matomo-analytics-tracking-api)

The PHP Tracker Client provides all features of the [Matomo Javascript Tracker](https://developer.matomo.org/api-reference/tracking-javascript), such as Ecommerce Tracking, Custom Variables, Event Tracking and more.

Documentation and examples
--------------------------

[](#documentation-and-examples)

Check out our [Matomo-PHP-Tracker developer documentation](https://developer.matomo.org/api-reference/PHP-Piwik-Tracker) and [Matomo Tracking API guide](https://matomo.org/docs/tracking-api/).

```
// 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:
-------------

[](#requirements)

- JSON extension (json\_decode, json\_encode)
- cURL or stream extension (to issue the HTTPS request to Matomo)

Installation
------------

[](#installation)

### Composer

[](#composer)

```
composer require matomo/matomo-php-tracker

```

### Manually

[](#manually)

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

```
require_once("MatomoTracker.php");

```

License
-------

[](#license)

Released under the [BSD License](https://opensource.org/licenses/BSD-3-Clause)

###  Health Score

72

—

ExcellentBetter than 100% of packages

Maintenance76

Regular maintenance activity

Popularity63

Solid adoption and visibility

Community41

Growing community involvement

Maturity92

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~138 days

Recently: every ~250 days

Total

30

Last Release

149d ago

Major Versions

1.5.2 → 2.0.02020-01-01

2.0.3 → 3.0.02020-11-21

PHP version history (5 changes)2.0.2PHP ^5.3

2.0.3PHP &gt;=5.3

3.1.1PHP ^7.0 || ^8.0

3.3.0PHP ^7.2 || ^8.0

3.4.0PHP ~7.2 || ~7.3 || ~7.4 || ~8.0 || ~8.1 || ~8.2 || ~8.3 || ~8.4 || ~8.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/80e09d9121023df96ecb1fc20edac8c3d9b724b50dbd3815fa264ae1a6adc58b?d=identicon)[matomo](/maintainers/matomo)

---

Top Contributors

[![sgiehl](https://avatars.githubusercontent.com/u/1579355?v=4)](https://github.com/sgiehl "sgiehl (62 commits)")[![tsteur](https://avatars.githubusercontent.com/u/273120?v=4)](https://github.com/tsteur "tsteur (53 commits)")[![diosmosis](https://avatars.githubusercontent.com/u/125140?v=4)](https://github.com/diosmosis "diosmosis (19 commits)")[![silvershadowcc](https://avatars.githubusercontent.com/u/36823114?v=4)](https://github.com/silvershadowcc "silvershadowcc (10 commits)")[![mattab](https://avatars.githubusercontent.com/u/466765?v=4)](https://github.com/mattab "mattab (7 commits)")[![rafiberlin](https://avatars.githubusercontent.com/u/5116794?v=4)](https://github.com/rafiberlin "rafiberlin (4 commits)")[![lutdev](https://avatars.githubusercontent.com/u/9608305?v=4)](https://github.com/lutdev "lutdev (3 commits)")[![Chris8934](https://avatars.githubusercontent.com/u/44963939?v=4)](https://github.com/Chris8934 "Chris8934 (3 commits)")[![vpapaloukas](https://avatars.githubusercontent.com/u/29273535?v=4)](https://github.com/vpapaloukas "vpapaloukas (2 commits)")[![exussum12](https://avatars.githubusercontent.com/u/1102850?v=4)](https://github.com/exussum12 "exussum12 (2 commits)")[![gsteel](https://avatars.githubusercontent.com/u/2803720?v=4)](https://github.com/gsteel "gsteel (2 commits)")[![leighmarble](https://avatars.githubusercontent.com/u/422876?v=4)](https://github.com/leighmarble "leighmarble (2 commits)")[![igorRovenki](https://avatars.githubusercontent.com/u/2495738?v=4)](https://github.com/igorRovenki "igorRovenki (1 commits)")[![madman-81](https://avatars.githubusercontent.com/u/50033071?v=4)](https://github.com/madman-81 "madman-81 (1 commits)")[![HomerBond005](https://avatars.githubusercontent.com/u/832996?v=4)](https://github.com/HomerBond005 "HomerBond005 (1 commits)")[![mbrodala](https://avatars.githubusercontent.com/u/5037116?v=4)](https://github.com/mbrodala "mbrodala (1 commits)")[![michalkleiner](https://avatars.githubusercontent.com/u/233342?v=4)](https://github.com/michalkleiner "michalkleiner (1 commits)")[![mzaman](https://avatars.githubusercontent.com/u/154233?v=4)](https://github.com/mzaman "mzaman (1 commits)")[![olleharstedt](https://avatars.githubusercontent.com/u/607341?v=4)](https://github.com/olleharstedt "olleharstedt (1 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")

---

Tags

matomophpphp-clientpiwikmatomoanalyticstracker

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/matomo-matomo-php-tracker/health.svg)

```
[![Health](https://phpackages.com/badges/matomo-matomo-php-tracker/health.svg)](https://phpackages.com/packages/matomo-matomo-php-tracker)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.4k37.3k](/packages/matomo-matomo)[composer/installers

A multi-framework Composer library installer

1.4k136.0M6.0k](/packages/composer-installers)[fof/analytics

Tracks analytics using Google Analytics, Google Optimize/GTM and Matomo

3543.1k](/packages/fof-analytics)[mediawiki/matomo

The Matomo (ex-Piwik) extension inserts your Matomo tracking code to the bottom of every page.

174.5k](/packages/mediawiki-matomo)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
