A Laravel package for proxying Plausible Analytics, improving performance and privacy.
mattitjaab/laravel-plausible-proxy is a Laravel package for a laravel package for proxying plausible analytics, improving performance and privacy..
It currently has 0 GitHub stars and 276 downloads on Packagist (latest version v1.5).
Install it with composer require mattitjaab/laravel-plausible-proxy.
Discover more Laravel packages by mattitjaab
or browse all Laravel packages to compare alternatives.
Last updated
A Laravel package for proxying Plausible Analytics, improving performance.
Install the package via Composer:
composer require mattitjaab/laravel-plausible-proxy
Publish the configuration file:
php artisan vendor:publish --tag=plausible-proxy-config
Add the following environment variables to your .env file:
PLAUSIBLE_DOMAIN=https://plausible.io
The config/plausible-proxy.php file allows you to customize the plausible domain:
return [
'domain' => env('PLAUSIBLE_DOMAIN', 'https://plausible.io'),
];
This package proxies Plausible's script.js while caching it to improve performance and reduce external requests.
After installation, you can include the script like this:
<script defer data-domain="example.com" src="https://raw.githubusercontent.com/MattitjaAB/laravel-plausible-proxy/refs/heads/main/js/script.js"></script>
The route /js/script.js is automatically handled and caches the script for 6 hours.
Instead of sending events directly to plausible.io, the script is loaded from /js/script.js and proxies the request to Plausible via /api/event, helping to prevent blocking by ad blockers.
.env.You can run tests with:
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.