mirror of
https://github.com/hanzoai/dataroom.git
synced 2026-10-30 18:41:07 +00:00
- Create new Tinybird pipe get_dataroom_view_document_stats for bulk document view stats - Add API endpoint for dataroom view document stats with per-page chart support - Create SWR hooks with deferred loading (enabled flag) - Create reusable DocumentViewDuration, DocumentViewCompletion, DocumentPageChart components - Create DataroomViewStats component combining history with stats - Update dataroom-visitors-table.tsx and dataroom-viewers.tsx to track expansion state - Stats only load when visitor row is expanded (deferred loading) - Per-page charts only load when individual document line is expanded Co-authored-by: Marc Seitz <[email protected]>
17 lines
329 B
Plaintext
17 lines
329 B
Plaintext
VERSION 1
|
|
|
|
NODE endpoint
|
|
SQL >
|
|
%
|
|
SELECT
|
|
viewId,
|
|
documentId,
|
|
SUM(duration) AS sum_duration,
|
|
COUNT(DISTINCT pageNumber) AS pages_viewed
|
|
FROM
|
|
page_views__v3
|
|
WHERE
|
|
viewId IN splitByChar(',', {{ String(viewIds, required=True) }})
|
|
GROUP BY
|
|
viewId, documentId
|