Dashboard Analytics

Adds Plausible and Google Analytics widgets to the Payload admin dashboard, navigation, collections and globals.

Community 177 21/wk MIT v0.3.0

Installation

pnpm add @nouance/payload-dashboard-analytics

About

The plugin pulls analytics data from Plausible or Google Analytics 4 into the Payload admin panel. You configure a provider once in your Payload config, then attach widgets to the dashboard, the sidebar navigation, individual collections, and globals. Dashboard widgets include a views chart and a top pages report. The sidebar gets an optional live visitors indicator. On collections and globals you can add per-page chart and info widgets that match the current document to a URL via an `idMatcher` function, and pick metrics such as views, visitors, sessions, session duration and bounce rate over timeframes like `7d`, `30d`, `6mo` or `currentMonth`. The plugin adds custom API endpoints to fetch the analytics data, and these routes are unprotected by default. An `access` function lets you gate them to authenticated users. To avoid hitting provider rate limits, enabling `cache` creates an `analyticsData` collection that stores responses with configurable per-route TTLs (defaults are one day for reports, five minutes for live data). GA4 support requires service-account credentials with read access, and Plausible needs an API secret plus site ID. Self-hosted Plausible instances work through an optional `host` option. The plugin targets Payload 1.6.x and registers its UI through the admin component and webpack hooks.

Package info

Package name
@nouance/payload-dashboard-analytics
Latest version
0.3.0
Unpacked size
265 kB
License
MIT
Weekly downloads
21
Last publish
May 25, 2023

More from NouanceLabs

View profile

Similar plugins

More in Analytics