Add click heatmaps report

Extracts click events from rrweb session-replay buffers at write time
into a new heatmap_event table (Prisma + ClickHouse). New /heatmaps
report shows a page picker plus an overlay of click density on the
dominant viewport, with an optional iframe of the live page behind.
This commit is contained in:
Mike Cao
2026-04-27 22:20:38 -07:00
parent 9da332c489
commit a6b13b71db
18 changed files with 831 additions and 0 deletions
@@ -0,0 +1,21 @@
-- Create heatmap_event
CREATE TABLE umami.heatmap_event
(
heatmap_event_id UUID,
website_id UUID,
session_id UUID,
visit_id UUID,
url_path String,
event_type UInt8,
node_id Nullable(Int32),
x Nullable(Int32),
y Nullable(Int32),
viewport_w Nullable(Int32),
viewport_h Nullable(Int32),
scroll_pct Nullable(UInt8),
created_at DateTime('UTC')
)
ENGINE = MergeTree
PARTITION BY toYYYYMM(created_at)
ORDER BY (website_id, url_path, event_type, created_at)
SETTINGS index_granularity = 8192;
+22
View File
@@ -344,3 +344,25 @@ AS SELECT
groupArrayState(data_type) AS property_types
FROM umami.event_data
GROUP BY website_id, session_id, event_id, event_name, url_path, created_at;
-- Create heatmap_event
CREATE TABLE umami.heatmap_event
(
heatmap_event_id UUID,
website_id UUID,
session_id UUID,
visit_id UUID,
url_path String,
event_type UInt8,
node_id Nullable(Int32),
x Nullable(Int32),
y Nullable(Int32),
viewport_w Nullable(Int32),
viewport_h Nullable(Int32),
scroll_pct Nullable(UInt8),
created_at DateTime('UTC')
)
ENGINE = MergeTree
PARTITION BY toYYYYMM(created_at)
ORDER BY (website_id, url_path, event_type, created_at)
SETTINGS index_granularity = 8192;