jeffersongoncalves / filament-gtm
Filament plugin for Google Tag Manager with settings page powered by Spatie Laravel Settings
Installs: 35
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 0
pkg:composer/jeffersongoncalves/filament-gtm
Requires
- php: ^8.2
- filament/filament: ^5.0
- filament/spatie-laravel-settings-plugin: ^5.0
- jeffersongoncalves/laravel-gtm: ^2.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.27
- orchestra/testbench: ^9.0|^10.0
README
Filament Google Tag Manager
Filament plugin for Google Tag Manager with a settings page powered by Spatie Laravel Settings. Manage your GTM container ID directly from the Filament admin panel.
Installation
You can install the package via composer:
composer require jeffersongoncalves/filament-gtm:"^3.0"
Publish the settings migrations and run them:
php artisan vendor:publish --tag=gtm-settings-migrations php artisan migrate
Usage
Register the Plugin
Add the plugin to your Filament panel provider:
use JeffersonGoncalves\Filament\Gtm\GtmPlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ GtmPlugin::make(), ]); }
The plugin will:
- Register a Settings Page where you can manage your GTM container ID
- Automatically inject GTM scripts into the
<head>and<body>sections of your Filament panels
Customization
Disable Settings Page
If you only want the automatic GTM injection without the settings page:
GtmPlugin::make() ->settingsPage(false),
Requirements
- PHP 8.2 or higher
- Filament 5.0
- Laravel 11.0 or higher
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
