Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Plausible

Laravel Plausible Laravel Package

jeffersongoncalves/laravel-plausible

A Laravel package for integrating Plausible Analytics into your PHP application. It provides simple configuration and a clean API for adding privacy-friendly, cookie-free analytics and tracking events from your Laravel projects.

View on GitHub
Deep Wiki
Context7

A lightweight Laravel package that integrates Plausible Analytics into your Blade views with database-backed settings via spatie/laravel-settings. Plausible.io is a privacy-friendly, open-source alternative to Google Analytics.

Frequently asked questions about Laravel Plausible
How do I install jeffersongoncalves/laravel-plausible in a Laravel application?
Install it with Composer using composer require jeffersongoncalves/laravel-plausible, then follow the README to publish any config, settings, or migration files and run your migrations. The package uses database-backed settings via spatie/laravel-settings, so make sure that dependency and its setup are in place. Verify the rendered Plausible script tag in a Blade view after installation.
Which Laravel and PHP versions does laravel-plausible support?
The provided overview does not list exact version constraints, so check the package's composer.json or Packagist metadata before installing. Confirm compatibility with your Laravel version, PHP version, Blade, Vite, and spatie/laravel-settings. For production upgrades, test in a staging app that matches your production dependency set.
Do I need spatie/laravel-settings to use this package?
Yes, the package uses spatie/laravel-settings for database-backed configuration, so that package and its settings migrations need to be set up as described in the README. You will typically configure the Plausible domain or site settings through the package's settings class rather than hard-coding values in Blade. Confirm the settings are loaded before rendering the analytics script.
How do I add the Plausible tracking script to Blade views?
The package is designed to render the Plausible script server-side in Laravel Blade views, so use the documented Blade component, directive, or include rather than manually pasting the snippet. Review the README for the exact integration point and supported attributes. After adding it, inspect the HTML output to confirm the script tag and configured domain are correct.
Does laravel-plausible support custom event tracking?
The package provides a clean API for adding Plausible analytics and tracking events from Laravel projects, according to its overview. Use the documented API or Blade integration for custom events, and verify the event payloads in Plausible's dashboard or debug tools. Keep event names consistent with your analytics plan to avoid fragmented reporting.
How does the Vite CSP nonce support work in this package?
The release propagates Laravel's Vite CSP nonce to the script tags the package emits when a nonce is configured. This lets apps use nonce-based script-src policies without adding unsafe-inline for package-rendered scripts. Validate that your CSP middleware generates the nonce before the package renders and that every emitted script tag includes the matching attribute.
What happens if no CSP nonce is configured?
The supplied materials do not document the exact no-nonce behavior, so verify it in your application or review the package source before relying on it. Check whether the package omits the nonce attribute, emits an empty nonce, or fails open when no nonce is available. Test both CSP-enabled and CSP-disabled paths in staging to confirm the script still loads as expected.
Will Laravel response caching break the Plausible CSP nonce?
CSP nonces are per-request values, so caching full HTML responses can serve a stale nonce that does not match the current CSP header. If you cache pages containing the Plausible script, exclude nonce-bearing HTML or use a caching strategy that regenerates the nonce. Monitor CSP violation reports after enabling enforcement.
Is Plausible cookie-free and privacy-friendly compared with Google Analytics?
Plausible is described as a privacy-friendly, open-source alternative to Google Analytics and is commonly used without cookies, though you should confirm current Plausible behavior and your legal requirements. This Laravel package only integrates the Plausible script and settings; it does not replace your privacy policy or consent review. Document the analytics setup for your compliance team.
How should I test laravel-plausible with CSP before production?
Start in staging with a report-only CSP, confirm the CSP middleware is active, and inspect rendered HTML for the Plausible script and nonce attribute. Verify middleware ordering, response caching, and any custom script rendering paths. Then enforce script-src with the nonce and monitor violation reports before a broad rollout.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core