PHPackages                             alfrasc/laravel-matomo-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. [HTTP &amp; Networking](/categories/http)
4. /
5. alfrasc/laravel-matomo-tracker

ActiveLibrary[HTTP &amp; Networking](/categories/http)

alfrasc/laravel-matomo-tracker
==============================

A Laravel facade/wrapper for the matomo/matomo-php-tracker for server side Matomo tracking.

v1.0.0(4y ago)1923.9k13[1 issues](https://github.com/alfrasc/laravel-matomo-tracker/issues)[2 PRs](https://github.com/alfrasc/laravel-matomo-tracker/pulls)BSD-3-ClausePHPCI failing

Since Dec 19Pushed 2y ago2 watchersCompare

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

READMEChangelog (3)Dependencies (5)Versions (4)Used By (0)

LaravelMatomoTracker
====================

[](#laravelmatomotracker)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e02deb0c19a55731b934ecd93d2279fedebcab9b400a46628c02c7e68c5346cf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c66726173632f6c61726176656c2d6d61746f6d6f2d747261636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/alfrasc/laravel-matomo-tracker)[![Total Downloads](https://camo.githubusercontent.com/1887df39a71885fe0151750b05534fd16b0e2f137202359de72d4db5ad73133b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616c66726173632f6c61726176656c2d6d61746f6d6f2d747261636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/alfrasc/laravel-matomo-tracker)

About
-----

[](#about)

The `alfrasc\laravel-matomo-tracker` Laravel package is a wrapper for the `piwik\piwik-php-tracker`. The Piwik php tracker allows serverside tracking.

Features
--------

[](#features)

- LaravelMatomoTracker Facade
- Queued tracking requests in Laravel queue

Feel free to suggest new features.

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

[](#installation)

Via Composer

Require the `alfrasc\laravel-matomo-tracker` package in your `composer.json` and update your dependencies:

```
$ composer require alfrasc/laravel-matomo-tracker
```

Publish the config file (optional)

Run `php artisan vendor:publish` to publish the config file if needed.

```
$ php artisan vendor:publish
```

Update your `.env`

Add these variables to your `.env` file and configure it to fit your environment.

```
[...]
MATOMO_URL="https://your.matomo-install.com"
MATOMO_SITE_ID=1
MATOMO_AUTH_TOKEN="00112233445566778899aabbccddeeff"
MATOMO_QUEUE="matomotracker"
MATOMO_QUEUE_CONNECTION="default"
[...]
```

That's it!

Usage
-----

[](#usage)

You can use the facade to track.

```
LaravelMatomoTracker::doTrackPageView('Page Title')
```

### Tracking

[](#tracking)

#### Basic functionality

[](#basic-functionality)

Please see the  page for basic method documentation.

Additionally there are some Methods to simplyfy the usage:

```
// instead of using
LaravelMatomoTracker::doTrackAction($actionUrl, 'download') // or
LaravelMatomoTracker::doTrackAction($actionUrl, 'link')

// you can use this
LaravelMatomoTracker::doTrackDownload($actionUrl);
LaravelMatomoTracker::doTrackOutlink($actionUrl);
```

#### Queues

[](#queues)

For queuing you can use these functions.

```
LaravelMatomoTracker::queuePageView(string $documentTitle)
LaravelMatomoTracker::queueEvent(string $category, string $action, $name = false, $value = false)
LaravelMatomoTracker::queueContentImpression(string $contentName, string $contentPiece = 'Unknown', $contentTarget = false)
LaravelMatomoTracker::queueContentInteraction(string $interaction, string $contentName, string $contentPiece = 'Unknown', $contentTarget = false)
LaravelMatomoTracker::queueSiteSearch(string $keyword, string $category = '',  $countResults = false)
LaravelMatomoTracker::queueGoal($idGoal, $revencue = 0.0)
LaravelMatomoTracker::queueDownload(string $actionUrl)
LaravelMatomoTracker::queueOutlink(string $actionUrl)
LaravelMatomoTracker::queueEcommerceCartUpdate(float $grandTotal)
LaravelMatomoTracker::queueEcommerceOrder(float $orderId, float $grandTotal, float $subTotal = 0.0, float $tax = 0.0, float $shipping = 0.0,  float $discount = 0.0)
LaravelMatomoTracker::queueBulkTrack()
```

For setting up queues, find the documentation on .

### Settings

[](#settings)

Have a look in the  page for basic settings documentation.

Additionaly these settings are available:

```
LaravelMatomoTracker::setCustomDimension(int $id, string $value) // only applicable if the custom dimensions plugin is installed on the Matomo installation
LaravelMatomoTracker::setCustomDimensions([]) // array of custom dimension objects {id: , value: } // bulk insert of custom dimensions and basic type checking
LaravelMatomoTracker::setCustomVariables([]) // array of custom variable objects {id: , name: , value: , scope: } // bulk insert of custom variables and basic type checking
```

Change log
----------

[](#change-log)

Please see the [changelog](changelog.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [contributing.md](contributing.md) for details and a todolist.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Alexander Schmidhuber](https://github.com/alfrasc)
- [All Contributors](../../contributors)

License
-------

[](#license)

BSD-3-Clause. Please see the [license file](license.md) for more information.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

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 ~350 days

Total

3

Last Release

1642d ago

Major Versions

v0.2.0 → v1.0.02021-11-18

### Community

Maintainers

![](https://www.gravatar.com/avatar/8357fc55fd2095c4432d71c31bf9b15311f2d63b75268936d68976b4223961a8?d=identicon)[alfrasc](/maintainers/alfrasc)

---

Top Contributors

[![AlexSchmidhuber](https://avatars.githubusercontent.com/u/59342502?v=4)](https://github.com/AlexSchmidhuber "AlexSchmidhuber (8 commits)")[![PunchRockgroin](https://avatars.githubusercontent.com/u/1855836?v=4)](https://github.com/PunchRockgroin "PunchRockgroin (3 commits)")[![tbruckmaier](https://avatars.githubusercontent.com/u/4941331?v=4)](https://github.com/tbruckmaier "tbruckmaier (3 commits)")[![alfrasc](https://avatars.githubusercontent.com/u/58988344?v=4)](https://github.com/alfrasc "alfrasc (2 commits)")

---

Tags

laravelpiwikserver side trackingMatomo PHP TrackerPiwik PHP Tracker

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[palanik/lumen-cors

Cross-origin resource sharing (CORS) middleware for Lumen micro-framework.

101237.4k](/packages/palanik-lumen-cors)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[laravel-shift/curl-converter

A command line tool to convert curl requests to Laravel HTTP requests.

935.3k](/packages/laravel-shift-curl-converter)[behamin/service-proxy

for proxy or sending requests to other services with useful utilities

102.2k](/packages/behamin-service-proxy)

PHPackages © 2026

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