Full dashboard (total events, unique users/sessions, top events, quota status, recent events)
Webhook Events
Event
Description
event.tracked
New event tracked
counter.incremented
Counter incremented
quota.exceeded
Quota limit exceeded
funnel.completed
Funnel completed
rollup.completed
Counter rollup completed
Counter System
Counters auto-increment across four time periods simultaneously:
Period
Description
hourly
Per-hour buckets
daily
Per-day buckets
monthly
Per-month buckets
all_time
Single cumulative counter (epoch start)
When an event is tracked via POST /v1/events, a matching counter is automatically incremented for the event name. Counters use upsert logic with ON CONFLICT ... DO UPDATE SET value = value + increment.
Rollup
The rollup operation aggregates hourly counters into daily and daily into monthly using SUM() with GROUP BY DATE_TRUNC(). Trigger manually via POST /v1/counters/rollup or the rollup CLI command.
Funnel Analysis
Funnels define a sequence of steps (events) that users should complete in order. The analysis engine:
Counts unique user_id values for the first step event
For each subsequent step, joins on user_id where the next event occurred within window_hours of the previous event
Returns per-step user counts, conversion rates, and drop-off rates
Quotas enforce limits on counter values. When a quota check finds the counter would exceed max_value, the system records a violation and returns allowed: false.
Standard webhook event tracking table with id, source_account_id, event_type, payload (JSONB), processed, processed_at, error, created_at.
Dashboard
The GET /v1/dashboard endpoint returns a comprehensive view:
Field
Description
total_events
Total tracked events
unique_users
Distinct user_id count
unique_sessions
Distinct session_id count
active_quotas
Enabled quota count
quota_violations
Violations in last 24 hours
top_events
Top 10 events by count
recent_events
Last 10 events
quota_status
Quota usage percentages, sorted by utilization
Troubleshooting
Events not appearing -- Verify event_name is provided in the request body. Check that the API key matches if ANALYTICS_API_KEY is set.
Counter values seem wrong -- Counters auto-increment across all four periods. Use the period query parameter to check specific time buckets. Run rollup to re-aggregate.
Funnel shows 0 users -- Funnel analysis requires events with non-null user_id. Verify events exist for all step event names.
Quota not enforcing -- Confirm the quota is enabled: true and the counter_name matches an existing counter. Quotas match by scope_id first, then fall back to scope_id IS NULL.
Batch rejected -- Ensure the events array does not exceed ANALYTICS_BATCH_SIZE (default: 100).