Download the PHP package poldixd/laravel-matomo-ai-bot-tracking without Composer

On this page you can find all versions of the php package poldixd/laravel-matomo-ai-bot-tracking. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-matomo-ai-bot-tracking

Laravel Matomo AI Bot Tracking

Track AI bot requests from a Laravel app in Matomo.

This package adds a middleware for Laravel. It uses a fast user-agent string check to detect AI bots and sends these requests to Matomo with recMode=1.

What It Does

The middleware tracks AI bot page requests on the server. It only tracks a request when all of these things are true:

The request to Matomo contains these fields:

The middleware does not send cip or cdt. This means it does not override the visitor IP or request time in Matomo.

Requirements

Matomo bot tracking needs support for the recMode tracking parameter.

Installation

Install the package with Composer:

Laravel will auto-discover the service provider.

Configuration

The package reads its settings from Laravel's services config. Add this to config/services.php:

Then add the values to your .env file:

MATOMO_TRACKING_URL is the base URL of your Matomo installation. Do not add /matomo.php here. The middleware adds it for you.

Middleware Usage

Register the middleware on the routes where you want to track AI bots.

For a Laravel 11+ application, add it to the middleware configuration in bootstrap/app.php:

For older Laravel applications that still use app/Http/Kernel.php, add it to the web middleware group:

Behavior

When an AI bot request matches the rules above, the middleware waits until Laravel has created the response. Then it sends a form POST request to:

If Matomo tracking fails, the user response is still returned as normal. The error is reported through Laravel and logged with useful request details.

Testing

Run the tests with:

Run the code style check with:

License

MIT


All versions of laravel-matomo-ai-bot-tracking with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^11.0 || ^12.0 || ^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package poldixd/laravel-matomo-ai-bot-tracking contains the following files

Loading the files please wait ...