Google Analytics
CommunityGoogle Analytics integration for Filament Panels with a set of widgets to display your analytics data in a beautiful way.
Author:
Bezhan Salleh
Package health
BetaAutomated checks of this plugin's Composer package
15 checks
- Failed: GitHub Actions pinned to SHA — View details on Plumb
- Skipped: GitLab CI includes pinned to SHA
- Passed: Open security advisories
- Passed: Dependabot PR responsiveness — No open Dependabot PRs.
- Skipped: Renovate MR responsiveness
- Passed: Dependabot or Renovate configured
-
Failed:
Dependency update cooldown configured
—
No cooldown configured in
.github/dependabot.yml. View details on Plumb - Passed: Provides a security policy
- Passed: Abandoned or archived — No consulted source marks the package abandoned (packagist, github).
- Passed: Commit and release recency — Active: last commit 29 days ago; last release 119 days ago.
-
Passed:
composer.lock not committed by library
—
composer.lockis absent from the released dist archive. - Passed: Dist archive is lean
-
Passed:
Current Laravel version supported
—
Package dependencies resolve together with current Laravel
13.0. -
Passed:
Current PHP version supported
—
Constraint
^8.3supports current PHP8.5. - Skipped: Current Symfony version supported
filament/
namespace. Review the source and install at your own risk. Found
malware or an unresolved security issue the author won't
address?
Report it
.
Documentation
Google Analytics integration for Filament Panels with a set of widgets to display your analytics data in a beautiful way.
#Compatibility
| Package Version | Filament Version |
|---|---|
| 1.x | 2.x |
| 2.x | 3.x |
| 3.x | 4.x & 5.x |
#Upgrading from v2 to v3
If you are upgrading from version 2 to version 3, you will need to update the namespace anywhere you are using the plugin from BezhanSalleh\FilamentGoogleAnalytics to BezhanSalleh\GoogleAnalytics.
You can install the package in to a Laravel app that uses Filament via composer:
composer require bezhansalleh/filament-google-analytics
For now, follow the directions on Spatie's Laravel Google Analytics package for getting your credentials, then put them here:
yourapp/storage/app/analytics/service-account-credentials.json
Also add this to the .env for your Filament PHP app:
ANALYTICS_PROPERTY_ID=
[!IMPORTANT] If you have not set up a custom theme and are using Filament Panels follow the instructions in the Filament Docs first.
After setting up a custom theme add the following to your theme css file.
@source '../../../../vendor/bezhansalleh/filament-google-analytics/resources/views/**/*';
@source '../../../../vendor/bezhansalleh/filament-google-analytics/src/{Widgets,Support}/*';
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
...
\BezhanSalleh\GoogleAnalytics\GoogleAnalyticsPlugin::make()
]);
}
All the widgets are enabled by default for you to use them in your filament pages/resources. In order to enable the widgets for the default filament dashboard, you need to set the filament_dashboard option to true in the config file google-analytics.php for each widget you want to enable.
Publish the config files and set your settings:
php artisan vendor:publish --tag=google-analytics-config
#Available Widgets
use BezhanSalleh\GoogleAnalytics\Widgets;
Widgets\PageViewsWidget::class,
Widgets\VisitorsWidget::class,
Widgets\ActiveUsersOneDayWidget::class,
Widgets\ActiveUsersSevenDayWidget::class,
Widgets\ActiveUsersTwentyEightDayWidget::class,
Widgets\SessionsWidget::class,
Widgets\SessionsByCountryWidget::class,
Widgets\SessionsDurationWidget::class,
Widgets\SessionsByDeviceWidget::class,
Widgets\MostVisitedPagesWidget::class,
Widgets\TopReferrersListWidget::class,
#Custom Dashboard
Though this plugin comes with a default dashboard, but sometimes you might want to change navigationLabel or navigationGroup or disable some widgets or any other options and given that the dashboard is a simple filament page; The easiest solution would be to disable the default dashboard and create a new page:
php artisan filament:page MyCustomDashboardPage
then register the widgets you want from the Available Widgets list either in the getHeaderWidgets() or getFooterWidgets():
<?php
namespace App\Filament\Pages;
use Filament\Pages\Page;
use BezhanSalleh\GoogleAnalytics\Widgets;
class MyCustomDashboardPage extends Page
{
protected static ?string $navigationIcon = 'heroicon-o-document-text';
protected static string $view = 'filament.pages.my-custom-dashboard-page';
protected function getHeaderWidgets(): array
{
return [
Widgets\PageViewsWidget::class,
Widgets\VisitorsWidget::class,
Widgets\ActiveUsersOneDayWidget::class,
Widgets\ActiveUsersSevenDayWidget::class,
Widgets\ActiveUsersTwentyEightDayWidget::class,
Widgets\SessionsWidget::class,
Widgets\SessionsByCountryWidget::class,
Widgets\SessionsDurationWidget::class,
Widgets\SessionsByDeviceWidget::class,
Widgets\MostVisitedPagesWidget::class,
Widgets\TopReferrersListWidget::class,
];
}
}
[!NOTE]
In order to enable the widgets for the default filament dashboard, you need to set thefilament_dashboardoption totruein the config filegoogle-analytics.phpfor each widget you want to enable.
Widgets rendered in a dedicated dashboard (or any other page you create)

Please see CHANGELOG for more information on what has changed recently.
If you want to contribute to this packages, you may want to test it in a real Filament project:
- Fork this repository to your GitHub account.
- Create a Filament app locally.
- Clone your fork in your Filament app's root directory.
- In the
/filament-google-analyticsdirectory, create a branch for your fix, e.g.fix/error-message.
Install the packages in your app's composer.json:
"require": {
"bezhansalleh/filament-google-analytics": "dev-fix/error-message as main-dev",
},
"repositories": [
{
"type": "path",
"url": "filament-google-analytics"
}
]
Now, run composer update.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.
The author
Bezhan Salleh is a full-stack developer with a strong focus on backend development and a passion for open-source. He’s the creator of Shield, Filament’s most starred plugin, and the author of other popular plugins, including Plugin Essentials and Google Analytics. His work focuses on delivering practical, powerful solutions with an emphasis on performance and developer experience.
From the same author
Plugin Essentials
A collection of essential traits that streamline Filament plugin development by taking care of the boilerplate, so you can focus on shipping real features faster.
Author:
Bezhan Salleh
Shield
The easiest and most intuitive way to handle `Policies` and `Permissions for your Filament Panels' components.
Author:
Bezhan Salleh
Exception Viewer
A Simple & Beautiful Exception Viewer plugin for your Filament Panels.
Author:
Bezhan Salleh
Panel Switch
Switch between Filament panels with ease.
Author:
Bezhan Salleh
Featured Plugins
A selection of plugins curated by the Filament team
Blueprint
Filament Blueprint is a premium Laravel Boost extension that helps AI agents produce accurate, detailed implementation plans and security reports for Filament apps.
Filament
Spotlight Pro
Browse your Filament Panel with ease. Filament Spotlight Pro adds a Spotlight/Raycast like Command Palette to your Filament Panel.
Dennis Koch
Advanced Tables (formerly Filter Sets)
Supercharge your tables with powerful features like user-customizable views, quick filters, multi-column sorting, advanced table searching, convenient view management, and more. Compatible with Resource Panel Tables, Relation Managers, Table Widgets, and Table Builder!
Kenneth Sese