Pular para o conteúdo
← Voltar para projetos

Filament Metrics Plausible

Filament plugin with Plausible Analytics dashboard widgets (realtime visitors, visitors chart, top pages, sources, countries, browsers and devices) and a Settings Page powered by Spatie Laravel Settings.

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

Filament Metrics Plausible

#Filament Metrics Plausible

Buy Me A Coffee

Latest Version on Packagist Tests Total Downloads License

Plausible Analytics dashboard widgets for Filament, with a settings page powered by Spatie Laravel Settings to manage your Plausible API key, site ID and instance URL directly from the admin panel. Works with Plausible Cloud and self-hosted instances.

Built on top of jeffersongoncalves/laravel-metrics-plausible (Stats API v2).

#Compatibility

Branch Filament Package version
1.x 3.x ^1.0
2.x 4.x ^2.0
3.x 5.x ^3.0

#Installation

You can install the package via composer:

composer require jeffersongoncalves/filament-metrics-plausible:"^3.0"

Publish the settings migrations and run them:

php artisan vendor:publish --tag=metrics-plausible-settings-migrations
php artisan migrate

#Usage

Add the plugin to your Filament panel provider:

use JeffersonGoncalves\Filament\MetricsPlausible\PlausibleMetricsPlugin;

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

Then open Settings > Plausible Analytics in your panel and fill in the API key and site ID.

#Widgets

All widgets cover the last 30 days and are cached (15s for realtime, 5 minutes for the rest):

Widget Shows
RealtimeVisitorsWidget Visitors right now, unique visitors, pageviews, bounce rate and visit duration
VisitorsChartWidget Daily visitors and pageviews line chart
TopPagesWidget Top 10 pages by visitors
TopSourcesWidget Top 10 traffic sources with bounce rate
TopCountriesWidget Top 10 countries with share of visitors
TopBrowsersWidget Browsers doughnut chart
TopDevicesWidget Devices doughnut chart

#Customization

PlausibleMetricsPlugin::make()
    ->settingsPage(false) // hide the settings page
    ->widgets(false),     // don't register the dashboard widgets

With widgets(false) you can still place the widget classes on any page yourself.

#Requirements

  • PHP 8.2 or higher
  • Filament 5.x

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