ezitisitis / laravel-plausible-exclude
Adds a page to your Laravel app that excludes your browser from Plausible Analytics.
Package info
github.com/ezitisitis/laravel-plausible-exclude
Language:Hack
pkg:composer/ezitisitis/laravel-plausible-exclude
Requires
- php: >=8.2
- illuminate/routing: >=12.0
- illuminate/support: >=12.0
- illuminate/view: >=12.0
Requires (Dev)
- orchestra/testbench: >=10.0
- phpunit/phpunit: >=11.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Adds a page to your Laravel app that excludes your browser from Plausible Analytics.
Opening the page sets localStorage.plausible_ignore for that site, so your own visits stop being counted. A button lets you turn it back off. The flag is per browser and per site, so open the page on each device you use.
The page is noindex, nofollow and does not load the Plausible script itself.
Requirements
PHP 8.2+ and Laravel 12 or newer.
Installation
composer require ezitisitis/laravel-plausible-exclude
Then visit yourapp.com/plausible.
Configuration
Change the path with an environment variable:
PLAUSIBLE_EXCLUDE_PATH=internal/exclude
or publish the config:
php artisan vendor:publish --tag=plausible-exclude-config
The route is named plausible-exclude. To change the page, publish the view:
php artisan vendor:publish --tag=plausible-exclude-views
If your app has a catch-all route, this route still wins, because package routes are registered before the app's routes.
Static exports
Nothing links to the page, so a crawler-based exporter (such as spatie/laravel-export) won't find it. Add the path to the exporter's list explicitly.
Upgrading from swiftmade/laravel-plausible-exclude
Replace the package with ezitisitis/laravel-plausible-exclude. The default path is still /plausible. If you published or referenced anything, note that the namespace is now Ezitisitis\PlausibleExclude and the view is plausible-exclude::exclude.
Testing
composer test
Changelog
See CHANGELOG for what has changed.
Credits
License
The MIT License (MIT). See License File.