You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hogflare serves product analytics from `/analytics`. The dashboard uses the repo's Sidemantic `events`, `pageviews`, and `sessions` models through the native Sidemantic/DuckDB Iceberg bridge.
4
+
5
+
## API Config
6
+
7
+
Product analytics shares the same R2 Data Catalog warehouse credentials as replay, but uses analytics-specific names when provided:
8
+
9
+
| Setting | Notes |
10
+
| --- | --- |
11
+
|`HOGFLARE_ANALYTICS_ACCOUNT_ID`| Cloudflare account id for the R2 Data Catalog warehouse. Falls back to `HOGFLARE_REPLAY_ACCOUNT_ID`. |
12
+
|`HOGFLARE_ANALYTICS_BUCKET`| R2 bucket name backing the warehouse. Falls back to `HOGFLARE_REPLAY_BUCKET`. |
13
+
|`HOGFLARE_ANALYTICS_R2_SQL_TOKEN`| R2 SQL/Data Catalog token. Store as a secret. Falls back to `HOGFLARE_REPLAY_R2_SQL_TOKEN`. |
14
+
|`HOGFLARE_ANALYTICS_EVENTS_TABLE`| Iceberg events table. Falls back to `HOGFLARE_REPLAY_EVENTS_TABLE`. |
15
+
|`HOGFLARE_ANALYTICS_PERSONS_TABLE`| Optional Iceberg persons table. Defaults are inferred from the events table. |
16
+
|`HOGFLARE_ANALYTICS_MODEL_DIR`| Optional Sidemantic model directory. Defaults to `models`. |
17
+
|`HOGFLARE_ANALYTICS_SIDEMANTIC_SCRIPT`| Optional override for the native analytics worker script. |
18
+
|`HOGFLARE_ANALYTICS_PREAGG`| Optional Sidemantic pre-aggregation switch. Defaults to enabled. Set to `0` to disable. |
19
+
|`HOGFLARE_ANALYTICS_PREAGG_SCHEMA`| Optional DuckDB schema for Sidemantic rollup tables. Defaults to `sidemantic_preagg`. |
20
+
21
+
## Routes
22
+
23
+
-`/` serves the Hogflare app and opens product analytics by default.
24
+
-`/analytics` serves the product analytics view.
25
+
-`/analytics/api/charts` returns overview metrics, a focused trend, and semantic breakdowns including domains, referrers, browser, country, region, and city leaderboards.
26
+
-`/replay` serves the replay feature.
27
+
28
+
At worker startup, Sidemantic materializes known count-based chart shapes into daily pre-aggregation rollups and automatically routes eligible queries through those tables. `metric`, `dimension`, and `granularity` choose the focused chart. `semantic_filters` carries clickable cross-filter state as a JSON object of semantic dimensions to values. Analytics leaderboards use a fixed top-10 row cap plus an Others row.
Hogflare stores replay uploads in the same events table as analytics events, then serves a read-only replay explorer from `/replay`. The UI is for product analytics workflows: browse recent sessions, search events, inspect funnel drop-offs, review computed friction signals, and follow a person journey.
5
+
Hogflare stores replay uploads in the same events table as product events, then serves a read-only replay explorer from `/replay`. The replay feature is for browsing recent sessions, searching events, inspecting funnel drop-offs, reviewing computed friction signals, and following a person journey.
6
6
7
7
## Ingestion
8
8
@@ -27,14 +27,16 @@ Replay APIs require:
27
27
28
28
The token stays server-side in the Worker. The browser only calls Hogflare's replay API.
29
29
30
+
Product analytics has a separate first-class route and API. See [product analytics](product-analytics.md).
31
+
30
32
## Routes
31
33
32
34
-`/replay` serves the explorer UI.
33
35
-`/replay/api/sessions` lists replay sessions by reading `$snapshot_items` and legacy `$snapshot` rows from Iceberg through R2 SQL.
34
-
-`/replay/api/events` searches analytics events while excluding replay recording rows.
36
+
-`/replay/api/events` searches product events while excluding replay recording rows.
35
37
-`/replay/api/funnels` classifies sessions as converted, stuck, or dropped for an ordered `steps` list of event names.
36
38
-`/replay/api/friction` computes replay-derived signals such as rage clicks, dead clicks, form thrash, long idle gaps, repeated navigation, and deep scroll without follow-up.
37
-
-`/replay/api/person` joins a distinct ID's replay sessions and analytics events into one journey timeline.
39
+
-`/replay/api/person` joins a distinct ID's replay sessions and product events into one journey timeline.
38
40
-`/replay/api/sessions/:session_id` returns normalized rrweb events plus an activity timeline for one session.
0 commit comments