PHP code example of poldixd / laravel-matomo-ai-bot-tracking

1. Go to this page and download the library: Download poldixd/laravel-matomo-ai-bot-tracking library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

poldixd / laravel-matomo-ai-bot-tracking example snippets


'matomo' => [
    'enabled' => env('MATOMO_AI_BOT_TRACKING_ENABLED', false),
    'tracking_url' => env('MATOMO_TRACKING_URL'),
    'site_id' => env('MATOMO_SITE_ID'),
    'source' => env('MATOMO_AI_BOT_TRACKING_SOURCE', 'laravel'),
],

use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Middleware;
use poldixd\MatomoAIBotTracking\Middleware\MatomoAIBotTracking;

return Application::configure(basePath: dirname(__DIR__))
    ->withMiddleware(function (Middleware $middleware) {
        $middleware->web(append: [
            MatomoAIBotTracking::class,
        ]);
    })
    ->create();

protected $middlewareGroups = [
    'web' => [
        // ...
        \poldixd\MatomoAIBotTracking\Middleware\MatomoAIBotTracking::class,
    ],
];
text
{MATOMO_TRACKING_URL}/matomo.php