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 Metrics Ga4 Laravel Package

jeffersongoncalves/filament-metrics-ga4

Filament plugin that brings Google Analytics 4 metrics into your admin dashboard. Display GA4 sessions, users, page views, and other key stats as native Filament widgets, so you can monitor traffic and performance without leaving your panel. Requires a Google service account for GA4 Data API access.

View on GitHub
Deep Wiki
Context7

Getting Started

This package is a Filament plugin that registers an analytics settings page in your panel. Start by installing it alongside its core dependency filament-analytics-core (v3.1+ is required for the newest navigation features):

composer require vendor/filament-analytics

Register the plugin on your Filament panel provider — this is where most day-to-day configuration lives:

use Vendor\FilamentAnalytics\Plugin;

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

Look first at the Plugin class (the fluent entry point) and any published config file (php artisan vendor:publish --tag=filament-analytics-config) — that's where data sources, credentials, and display options are wired. The first use case is almost always: mount the default settings/analytics page, confirm it renders in your panel, then point it at a real data source.

Implementation Patterns

Customizing navigation placement (new in 3.1.0). By default the page lives in the plugin's translated navigation group. To fold it into one of your panel's existing groups — e.g. "Reporting" or "Settings" — use the new fluent method:

Plugin::make()
    ->navigationGroup('Reporting'),

Because the signature accepts string|Closure, you can resolve the group dynamically (per-tenant panels, role-based layouts, localization):

Plugin::make()
    ->navigationGroup(fn () => auth()->user()->isAdmin() ? 'Administration' : 'Reporting'),

Panel-scoped registration. Register different plugin configurations per panel when you have multiple Filament panels (admin vs. tenant). Each panel instance can carry its own navigationGroup, keeping the analytics page co-located with the rest of that panel's IA.

Compose with other plugin options. Treat navigationGroup() as one link in a fluent chain — set it alongside whatever analytics configuration the plugin already exposes (data source, refresh cadence, widget toggles). Keep the chain readable by breaking it across lines.

Integration tip: if your panel already defines navigation groups explicitly via ->navigationGroups([...]), pass a matching label string to navigationGroup() so Filament doesn't create a silent duplicate group. When in doubt, use a Closure that returns the canonical label from a shared constant.

Gotchas and Tips

  • Dependency floor: navigationGroup() is only available on filament-analytics-core 3.1+. If you pin core below 3.1 you won't get the method (and on this plugin 3.1.0 the call may silently no-op or error depending on how it's guarded). Bump core in the same PR.
  • Fallback behavior: omitting navigationGroup() keeps the translated group — this is intentional and non-breaking. Existing installs need no changes.
  • Duplicate groups: the method does not validate that the group you name exists in your panel. A typo yields a new, orphaned group. Define group labels as constants and share them between your panel and this plugin.
  • Closure timing: a Closure is evaluated when the page is registered/navigated, not at boot. Don't rely on request-scoped state that isn't available at that point (e.g. route params on the navigation render).
  • Translation interplay: passing a literal string bypasses translation of the group name. If your panel is multilingual, either wrap the literal in __() yourself or return a translated string from the Closure.
  • Debugging placement: if the page shows up in an unexpected group, check for competing navigationGroup registrations across plugins and any panel-level default. php artisan filament:optimize-clear (and a cache clear) resolves stale navigation caches after config changes.
  • Extension point: the Closure signature is the cleanest hook for multi-tenant/role-aware navigation — prefer it over subclassing Plugin so you stay on the supported upgrade path.
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.
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels
wazza/laravel-db-encryption
hokny/laravel-generator
vonsogt/backup
jengo/queues
jeremykenedy/laravel-observability
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums