Analytics
Adds a GA4-backed analytics dashboard inside the Payload admin, with KPIs, sessions, and lead-action tracking driven by the GA4 Data API and gtag.js.
Installation
pnpm add @focus-reactive/payload-plugin-analytics About
This plugin brings Google Analytics 4 data directly into the Payload CMS v3 admin. The `analyticsPlugin()` function injects a dashboard view at `/admin/analytics` and a set of REST endpoints under `/api/analytics/*`. Those endpoints read reports from the GA4 Data API using a Google Cloud service account. No analytics data is written to your database, so GA4 remains the single source of truth. The client half is a React provider. `AnalyticsProvider` paired with `ga4Provider()` wraps your front end, injects `gtag.js`, and tracks `page_view` events on initial load and on every route change. The `Track`, `TrackPage`, and `TrackLeadAction` components plus the `useAnalytics` hook let you fire engagement events and `lead_action` conversion events. Lead action types are configurable (for example `phone_click`, `email_click`, `form_submit`). The dashboard surfaces KPIs, traffic trends, top pages, sources, events, devices, geography, sessions, and journeys, along with a Lead Actions tab. An optional A/B tab integrates with the sibling `@focus-reactive/payload-plugin-ab` package. The dashboard layout is extensible through custom blocks, and endpoint access is configurable via an access function. A mock mode lets you develop against the dashboard locally without hitting GA4. Setup requires a GA4 property, a Measurement ID, and a service account with the Google Analytics Data API enabled. The service account needs Viewer access on the GA4 property. Event-scoped custom dimensions (`fr_session_id`, `fr_lead_type`, and others) and the `fr_elapsed_ms` custom metric must be registered in GA4 for the dashboards to populate. Reports inherit GA4 sampling and its data-freshness latency, so new events take a few minutes to appear.
Package info
- Package name
@focus-reactive/payload-plugin-analytics- Latest version
1.2.2- Unpacked size
- 1.5 MB
- License
- MIT
- Weekly downloads
- 215
- Last publish
- Jul 8, 2026
More from focusreactive
View profileTranslator
Translates localized Payload CMS content into any locale via pluggable providers, with document, bulk-collection, and per-field controls in the admin UI.
A/B Testing
A/B testing plugin that creates page variants in Payload collections and routes traffic at the edge via Next.js middleware.
SEO
Adds live Yoast SEO analysis to the Payload v3 document editor with a SERP preview, keyphrase checks, and readability scoring.
Collaborative Comments
Adds document-level and field-level comments to the Payload admin panel, with @mentions, email notifications, resolution, multi-tenancy and locale filtering.
Presets
Save and apply reusable block configurations as presets in the Payload admin panel.
Create Ideal CMS
Scaffolds a production-ready Payload CMS monorepo preconfigured with the @focus-reactive plugin suite.
Similar plugins
More in AnalyticsSales Reports
Sales reporting plugin that totals revenue, units and orders by period, product and customer from Payload order collections.
Sentry
Integrates Sentry error tracking into Payload applications.
SEO Analyzer
Payload plugin that audits page SEO in the editor sidebar with 50+ checks, a dashboard, score history, redirects and IndexNow.
GA4 Analytics
Integrates Google Analytics 4 into Payload CMS with admin dashboards and reporting.
PageSpeed Insights
Integrates Google PageSpeed Insights into Payload CMS for performance analysis.