Contents
PR Summary
What problems was I solving
User interaction sequences (scroll depth, video watching, conversations, etc.) were not materialized. The prospect timeline UI had to reconstruct raw events for every view, incurring read latency and limiting the ability to compute summary-level aggregates beyond click counters.
What user-facing changes did I ship
The prospect timeline now displays deeper user behavior signals: scroll depth direction and percentage, video watch time windows and completion status. Timeline tooltips include component snapshot attribution for richer debugging without additional volatile lookups.
How I implemented it
Implemented a sequence materialization pipeline in page-analytics-service that: (1) ingests analytics events and component snapshots, (2) reduces raw events into semantic sequences (conversations, scroll runs, video runs, general actions), (3) persists sequences to a new analytic_session_sequences table, (4) derives interaction aggregate fields (thread count, FAQ hits, keyword clicks, meaningful-interaction flag) for analytics_session_summaries, and (5) switches the timeline read path to use materialized sequences when available. The service recomputes summaries plus sequences after form conversions and batch event processing. UI components were extended to render new scroll_depth and video_watched timeline item types.
Description for the changelog
Add analytic_session_sequences table with unique constraints on tenant_id + sequence_id/projection_idempotency_key; add componentDepth, video time, interaction aggregates fields to analytics_session_summaries; implement sequence materialization; update timeline API and UI with scroll/interaction semantics; upgrade CURRENT_SUMMARY_VERSION to 5.