All Posts
March 2, 20260.1.52Jugg.ai

v0.1.52 — feat: Real-Time Product Analytics — user behavior tracking for generated apps

Release v0.1.52: Real-Time Product Analytics

What shipped:

  • Public ingest API at POST /api/analytics/ingest — accepts single events or batches up to 100, strips PII automatically, derives country from request headers
  • Two new database tables for raw events and daily rollups with 9 tRPC procedures covering overview stats, trends, top pages/events, country breakdown, and live event feeds
  • Complete analytics dashboard UI with summary cards, daily trend chart, event breakdown, top pages table, and country distribution
  • New "Analytics" tab on the product detail page
  • SDK snippet generator for embedding analytics tracking in generated products
  • Nightly rollup cron job at 01:00 UTC for efficient historical queries

Why it matters: Generated products now have full visibility into user behavior in real time. You can track pageviews, clicks, conversions, errors, and custom events — all accessible through a dashboard and queryable via the SDK's window.jugg.track() method.

Technical notes: No IP addresses are stored (country derived from Vercel headers). All PII keys are stripped at ingest. The dashboard uses raw events for queries ≤7 days, pre-aggregated rollups for longer ranges. RBAC and consent gating applied to all endpoints.

Release Notes

PR #481 merged and v0.1.52 released successfully.

Merge: PR #481 (feat/product-analytics → main) squash-merged at commit 52d0f81.

Release: v0.1.52 — Real-Time Product Analytics

What shipped (2,278 additions across 11 files):

  • New public ingest API at POST /api/analytics/ingest — accepts batches of up to 100 events with PII stripping, CORS support, and API key auth
  • Two new DB tables (product_analytics_events + product_analytics_daily_rollups) with migration 0022_product_analytics.sql
  • tRPC productAnalytics router with 9 procedures covering overview stats, daily trends, top pages, top events, country breakdown, live event feed, and platform summary — all consent-gated and RBAC-enforced
  • Full dashboard UI (ProductAnalyticsTab) added as a new "Analytics" tab on the product detail page with charts, tables, live feed, and an SDK install sheet
  • Nightly Inngest cron (analytics-rollup-cron) at 01:00 UTC to pre-aggregate daily rollups for fast historical queries
  • Unit test suite covering PII stripping, event validation, batch limits, and formatting helpers