jeffersongoncalves / 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.
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
pkg:composer/jeffersongoncalves/filament-mixpanel
Requires
- php: ^8.2
- filament/filament: ^5.0
- filament/spatie-laravel-settings-plugin: ^5.0
- jeffersongoncalves/laravel-mixpanel: ^1.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- larastan/larastan: ^3.0
- orchestra/testbench: ^9.0|^10.0
README
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.