PHPackages                             mattitjaab/matomo-proxy-laravel - 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. mattitjaab/matomo-proxy-laravel

ActiveLibrary

mattitjaab/matomo-proxy-laravel
===============================

This is my package matomo-proxy-laravel

v1.0.0(8mo ago)23[4 PRs](https://github.com/MattitjaAB/matomo-proxy-laravel/pulls)MITPHPPHP ^8.3CI passing

Since Aug 20Pushed 1mo agoCompare

[ Source](https://github.com/MattitjaAB/matomo-proxy-laravel)[ Packagist](https://packagist.org/packages/mattitjaab/matomo-proxy-laravel)[ Docs](https://github.com/mattitjaab/matomo-proxy-laravel)[ GitHub Sponsors](https://github.com/MattitjaAB)[ RSS](/packages/mattitjaab-matomo-proxy-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (14)Versions (6)Used By (0)

Matomo Proxy for Laravel
========================

[](#matomo-proxy-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/cd251948e29961980d115dfbe5572ce404a0283c0e1a3ac9f6cdd914361b4b21/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61747469746a6161622f6d61746f6d6f2d70726f78792d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mattitjaab/matomo-proxy-laravel)[![GitHub Tests Action Status](https://camo.githubusercontent.com/794066bf2d647393bc47e7dfff9d94bfb90be7415ed7c995e2d57f793088814b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d61747469746a6161622f6d61746f6d6f2d70726f78792d6c61726176656c2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/mattitjaab/matomo-proxy-laravel/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/cacc8a93a70a634aa38c0ec5fc7e66a3287fe2422b760cca499b8fa68f04a24d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d61747469746a6161622f6d61746f6d6f2d70726f78792d6c61726176656c2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/mattitjaab/matomo-proxy-laravel/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/93bea8667cecc753b04db5a39d52991e4392dbbd318ab56259139c3f3a273cf7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d61747469746a6161622f6d61746f6d6f2d70726f78792d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mattitjaab/matomo-proxy-laravel)

This package provides a plug-and-play **server-side Matomo tracking middleware** for Laravel. Instead of embedding JavaScript trackers in your frontend, requests are tracked directly from your Laravel app to your Matomo instance, ensuring better privacy, ad-blocker resilience, and simplified integration.

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

[](#installation)

Install the package via Composer:

```
composer require mattitjaab/matomo-proxy-laravel
```

Publish the config file:

```
php artisan vendor:publish --tag="matomo-proxy-laravel-config"
```

This will create a `config/matomo-proxy-laravel.php` file. Example:

```
return [
    'enabled' => env('MATOMO_ENABLED', true),

    // Full Matomo tracking endpoint (must include /matomo.php)
    'base_url' => env('MATOMO_BASE_URL', ''),

    // Matomo site ID
    'site_id' => env('MATOMO_SITE_ID', null),

    // Optional token_auth (can be null for anonymous tracking)
    'token' => env('MATOMO_TOKEN', null),

    // Paths that should never be tracked
    'ignore' => [
        'telescope/*', 'horizon/*', 'health', '_debugbar/*',
    ],

    // HTTP client behavior
    'timeout' => env('MATOMO_TIMEOUT', 2),
    'retry' => [
        'times' => env('MATOMO_RETRY_TIMES', 0),
        'sleep' => env('MATOMO_RETRY_SLEEP_MS', 100), // milliseconds
    ],
];
```

Usage
-----

[](#usage)

Register the middleware globally in your `bootstrap/app.php`:

```
->withMiddleware(function (Middleware $middleware): void {
    $middleware->append(\MattitjaAB\MatomoProxyLaravel\Middleware\MatomoProxyLaravelMiddleware::class);
})
```

2. Configure your `.env` file:

```
MATOMO_ENABLED=true
MATOMO_BASE_URL=https://analytics.example.com/matomo.php
MATOMO_SITE_ID=1
MATOMO_TOKEN=null
MATOMO_TIMEOUT=2
MATOMO_RETRY_TIMES=0
MATOMO_RETRY_SLEEP_MS=100
```

✅ That’s it. All requests will now be tracked server-side in Matomo without requiring any frontend JS snippet.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

Credits
-------

[](#credits)

- [MattitjaAB](https://github.com/MattitjaAB)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance77

Regular maintenance activity

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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

Unknown

Total

1

Last Release

265d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2f056a6d34a58ca4e884445093eb513ee4ae7977ecdd937c099a3ea8399cac0d?d=identicon)[Mattitja](/maintainers/Mattitja)

---

Top Contributors

[![mathiaspalmqvist](https://avatars.githubusercontent.com/u/51116221?v=4)](https://github.com/mathiaspalmqvist "mathiaspalmqvist (8 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelMattitjaABmatomo-proxy-laravel

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/mattitjaab-matomo-proxy-laravel/health.svg)

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

###  Alternatives

[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[spatie/laravel-prometheus

Export Laravel metrics to Prometheus

2651.3M6](/packages/spatie-laravel-prometheus)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)

PHPackages © 2026

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