About this project
convex-analytics is a Convex component that provides first-party product and web analytics without third-party services. Events are sent to a high-speed HTTP ingest endpoint and stored in the developer's own Convex deployment.
Capabilities:
- Pageview tracking and custom event logging
- User identification via identify(userId, traits)
- Anonymous visitor and session tracking
- Referrer, UTM campaign, device, browser, OS, and country reporting
- Timeseries charts and KPI overview dashboards
- Event property breakdown queries
- Raw event, pageview, session, and visitor drill-down lists
- Browser SDK with auto-batching, localStorage/sessionStorage persistence, and optional auto-pageviews
- React Native SDK using AsyncStorage or a custom storage provider
- Multi-site support via write-key-scoped site records
- Retention defaults of 90 days for raw events and hourly rollups; daily rollups kept indefinitely
- Explicit cleanup actions callable from cron jobs
Architecture consists of five Convex tables—sites, visitors, sessions, events (append-only), and rollups (hourly/daily)—with a background worker that aggregates raw events into rollups. The dashboard queries read from both raw events and rollups.
Installation adds the npm package, registers the component on the Convex app, exposes an HTTP ingest route, provisions at least one site via a bootstrap mutation, then renders the AnalyticsDashboard React component backed by authenticated read queries.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.