Pular para o conteúdo
← Voltar para projetos

Filament Mixpanel

Filament plugin for Mixpanel analytics — tracking script injection and Settings Page to manage Mixpanel configuration directly from your Filament panel. Supports Filament v3, v4, and v5.

Versão: v3 v4 v5 · branch: 3.x

Filament Mixpanel

#Filament Mixpanel

Buy Me A Coffee

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

Filament plugin for Mixpanel analytics — tracking script injection and Settings Page to manage Mixpanel configuration directly from your Filament panel. Supports Filament v3, v4, and v5.

#Installation

You can install the package via composer:

composer require jeffersongoncalves/filament-mixpanel

This package depends on jeffersongoncalves/laravel-mixpanel which provides the core Mixpanel analytics integration for Laravel applications.

#Requirements

  • PHP 8.2 or higher
  • Laravel 11.0 or higher
  • Filament 5.0

#Usage

#1. Register the Plugin

Add the plugin to your PanelProvider:

use JeffersonGoncalves\Filament\Mixpanel\MixpanelPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            MixpanelPlugin::make(),
        ]);
}

This will automatically:

  • Inject the Mixpanel tracking script into your panel
  • Add a Settings Page to manage your Mixpanel configuration

#2. Run Settings Migration

If you haven't already, publish the spatie/laravel-settings migration to create the settings table:

php artisan vendor:publish --provider="Spatie\LaravelSettings\LaravelSettingsServiceProvider" --tag="migrations"

Then publish and run the Mixpanel settings migration:

php artisan vendor:publish --tag=mixpanel-settings-migrations
php artisan migrate

#3. Manage Settings

Navigate to Settings > Mixpanel Analytics in your Filament panel to configure:

  • Project Configuration — Project Token, API Host, Custom Library URL
  • Tracking & Debug — Debug Mode, Autocapture, Track Page Views
  • Storage & Cookies — Persistence method, Cookie Expiration, Secure Cookie, Cross Subdomain
  • Privacy & Geolocation — IP Geolocation, Property Blacklist, Opt Out by Default, UTM Persistence
  • Advanced Features — Session Recording percentage, Heatmap Data collection

#Disabling the Settings Page

If you only want the tracking script injection without the settings page:

MixpanelPlugin::make()
    ->settingsPage(false),

#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.

Nova versão disponível.