bext-plugin-analytics

Privacy-first analytics. No cookies, no personal data.

$ bext plugin add analytics
Version 1.2.0
Sandbox quickjs
Author miko-dev
License MIT
Downloads 7,512
Updated 2026-03-25

Tracks page views, custom events, and Web Vitals without cookies or personal data. Data stays on your server. GDPR/CCPA compliant by design — there's nothing to consent to.

Install

bext plugin add analytics

Config

[plugins.analytics]
dashboard_path = "/_analytics"
password = "$ANALYTICS_PASSWORD"
track_vitals = true
ignore_paths = ["/api/*", "/_*"]

What it tracks

  • Page views (path, referrer, country from IP — IP is never stored)
  • Custom events via `POST /_analytics/event`
  • Web Vitals: LCP, FID, CLS, TTFB, INP

Dashboard

Visit `/_analytics` to see a real-time dashboard. Protected by the password in your config. Shows:

  • Visitors today / this week / this month
  • Top pages, referrers, countries
  • Web Vitals distribution
  • Custom event counts

Client snippet

The plugin auto-injects a 600-byte tracking script into HTML responses. No manual setup needed. The script sends a single beacon on page load and reports Web Vitals when available.

To track custom events from your frontend:

fetch("/_analytics/event", {
  method: "POST",
  body: JSON.stringify({ name: "signup", props: { plan: "pro" } }),
});