Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Filament Laravel Analytics

Filament Laravel Analytics Laravel Package

andreaselia/filament-laravel-analytics

Filament plugin that brings Laravel Analytics into your admin panel, letting you view Google Analytics data without leaving Filament. Adds analytics widgets and pages so you can display traffic, visitors, and other key metrics directly in your dashboard.

View on GitHub
Deep Wiki
Context7

andreaselia/filament-laravel-analytics brings your site's Google Analytics data into the Filament admin panel, so traffic, sessions, and visitor metrics sit alongside the rest of your dashboard. Instead of switching tabs to the Analytics UI, you can review performance trends while managing content in the same place.

Getting started is minimal: install the package, connect your Analytics credentials, and add the provided widgets or page to any panel.

  • Surfaces Google Analytics metrics as Filament-ready views
  • Installs quickly via Composer with a configurable setup
  • Reuses your existing Laravel Analytics credentials
  • Drops into any Filament panel with no extra wiring
Frequently asked questions about Filament Laravel Analytics
How do I install andreaselia/filament-laravel-analytics in my Laravel app?
Install it with Composer using composer require andreaselia/filament-laravel-analytics. The package depends on spatie/laravel-analytics as its data source, so Composer will resolve that dependency too. After installing, register the plugin in your Filament panel provider and configure your Google Analytics credentials before opening the dashboard.
Which Filament and Laravel versions does this plugin support?
Because it is a Filament panel plugin, the supported Filament and Laravel versions are defined by the constraints in its composer.json. Check those constraints on Packagist or in the repository before installing, since a Filament plugin must match your panel's major version. When you upgrade Filament or Laravel, update the plugin at the same time and review its changelog for breaking changes.
How do I configure Google Analytics credentials for this plugin?
Credentials are handled by the underlying spatie/laravel-analytics package, which authenticates to Google Analytics with a service account JSON file. Publish that package's config file, point it at your service account credentials, and set the Analytics property or view ID you want to report on. Keep the JSON file out of version control and supply the path and property ID through environment variables.
How do I register the analytics plugin in a Filament panel provider?
Register it in the panel provider where you configure your Filament panel, following the standard Filament plugin pattern shown in the README. The plugin then adds its analytics dashboard and widgets to that panel. Once registered and configured, you can open the dashboard from inside your admin panel without visiting Google Analytics directly.
What widgets and metrics does the Filament analytics dashboard show?
The plugin provides Filament widgets that display Google Analytics metrics, focusing on key traffic and conversion statistics. Because they are standard Filament widgets, you can arrange them on a dashboard page alongside your other widgets. The README lists the exact widgets included and how to place them.
Do I need a Google service account and Analytics property ID to use it?
Yes. spatie/laravel-analytics calls the Google Analytics Data API using a Google Cloud service account, so you need to create a service account, enable the Analytics API, and grant that service account access to your Analytics property. You also provide the property ID in the package config. Without valid credentials and property access, the widgets cannot retrieve data.
How do I cache analytics data and avoid Google Analytics API rate limits?
Caching is configured through spatie/laravel-analytics, which caches API responses and lets you choose the cache store and expiration in its config. Increase the cache lifetime and use a shared store such as Redis or the database in production to reduce calls to Google. This keeps dashboard loads fast and helps you stay within Google Analytics API quotas.
How can I test the analytics widgets without calling the real Google API?
Because the widgets read data through spatie/laravel-analytics, you can bind a mock or fake implementation of that service in your tests so the widgets render predictable values. Alternatively, pre-populate the cache store used by the analytics package so the widgets never hit Google during test runs. Avoid using real credentials in automated tests.
Is it safe to use in production and how do I control who can see the analytics?
The dashboard uses server-side credentials, so never commit the service account JSON or expose it to the browser. Visibility is governed by Filament's panel authentication and authorization, so only users who can access the panel or the relevant page should see the analytics widgets. Use environment-based configuration and caching to keep credentials out of code and reduce API traffic.
How does this compare with building custom Filament widgets or other alternatives?
Building your own Filament widgets on top of spatie/laravel-analytics gives you full control, but you have to wire up API calls, caching, and layouts yourself. This plugin provides ready-made widgets so you can add an analytics dashboard faster. Other options include embedding a Google Analytics report iframe or switching to a different analytics provider entirely.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect