Saltar al contenido
← Volver a proyectos

Filament Gtm

Filament plugin for Google Tag Manager with settings page powered by Spatie Laravel Settings

Versión: v3 v4 v5 · branch: 3.x

Filament Gtm

#Filament Google Tag Manager

Buy Me A Coffee

Latest Version on Packagist GitHub Code Style Action Status Total Downloads License

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.

Nueva versión disponible.