← Zurück zu den Projekten
Filament Gtm
#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.