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
Filament Gtag

Filament Gtag Laravel Package

jeffersongoncalves/filament-gtag

A Filament plugin that adds Google Analytics gtag.js tracking to your admin panel, with configurable measurement IDs and simple setup for monitoring panel usage and visitor activity.

View on GitHub
Deep Wiki
Context7

Filament plugin for managing Google Analytics (Gtag) settings with spatie/laravel-settings integration

Frequently asked questions about Filament Gtag
How do I install jeffersongoncalves/filament-gtag in a Laravel app?
Install it with Composer, publish the package migrations and any required spatie/laravel-settings configuration, then register the plugin in your Filament PanelProvider. Run your migrations so the settings table is available, and configure a valid Google Analytics measurement ID from the admin settings page. Because the package depends on filament-analytics-core, spatie/laravel-settings, and jeffersongoncalves/laravel-gtag, check that all transitive constraints resolve before deploying.
Which Laravel and Filament versions does filament-gtag support?
The package is described as fitting Laravel 10, 11, and 12 with Filament 3 and Filament 4. In practice you should inspect the exact Composer constraints for the plugin, filament-analytics-core, spatie/laravel-settings, and laravel-gtag together. Filament major upgrades can break the admin settings page, so pin versions deliberately rather than relying on a broad range.
Where is the Google Analytics measurement ID stored, in .env or the database?
The main value of this plugin is that the gtag measurement ID is stored as a database-backed setting through spatie/laravel-settings and edited from a Filament admin page. That moves the ID out of .env or config files, so a marketing user can change it without a deployment. You still need to publish and run the settings migrations and ensure the settings class is bound correctly.
Does filament-gtag support Google Consent Mode v2 or a cookie consent banner?
Nothing in the package description indicates Consent Mode v2, a CMP integration, or a consent gate before gtag fires. The plugin appears to use jeffersongoncalves/laravel-gtag to inject the tracking script, so an admin-editable toggle may load analytics unconditionally. For EU or UK traffic, plan to wrap or replace the rendering layer with a consent-aware implementation.
Can I use filament-gtag with multiple Filament panels or a multi-tenant application?
You can likely register the plugin in more than one PanelProvider, but the documented behaviour does not establish whether each panel gets its own GA property or whether the setting is global. The navigationGroup() option added in 3.4.0 is useful for placing the settings page, but per-tenant resolution is not clearly documented. Verify multi-panel and tenant behaviour in a staging app before relying on it.
Does the plugin cache the Google Analytics settings or query the database on every page?
The read path is not detailed in the provided package information, so do not assume the measurement ID is cached per request. spatie/laravel-settings supports caching, but the plugin may read the setting during each panel render depending on how it is wired. Use Laravel query logging or a profiler to confirm the number of settings queries on a page.
How do I upgrade filament-gtag when it moves from laravel-gtag v2 to v3?
Version 1.3.0 changed the laravel-gtag constraint from ^2.0 to ^3.0, which means the underlying rendering contract has moved. Upgrade the plugin and laravel-gtag together in a branch, run Composer with explicit constraints, and smoke-test that the gtag snippet still renders with your measurement ID. Also check the required filament-analytics-core version, because 3.4.0 hard-requires a specific minor.
Can I use filament-gtag without spatie/laravel-settings?
No, spatie/laravel-settings is a core dependency for persistence, so the plugin expects that package and its settings migrations to be present. If your application does not already use spatie/laravel-settings, you inherit an extra migration, a cache-driver dependency, and the settings-resolution concept. For a single analytics ID, that overhead may be greater than the package's value.
What are alternatives to filament-gtag for adding Google Analytics to a Filament panel?
The simplest alternative is a small Blade partial that renders the gtag.js snippet with an ID from config or .env. You could also build a custom Filament settings page backed by spatie/laravel-settings, or use Google Tag Manager if you need a container-based setup. This package mainly saves you from writing that admin surface and from redeploying when the measurement ID changes.
Is jeffersongoncalves/filament-gtag production-ready and actively maintained?
The repository is alive, with Dependabot activity and many contributed locales, but it has a single maintainer, very few stars, and no visible dependents. There is no evidence of production usage beyond the author's own plugin family, and no published deprecation or upgrade policy across Filament majors. Pin the plugin and its transitive dependencies, add a smoke test for gtag rendering, and be prepared to maintain or replace the rendering layer.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
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