feat(analytics): Events card + eventName filter on Web Analytics - #565
Merged
Conversation
Custom `track()` events were stored (session_events Type='custom', web_events Kind='custom') but nothing on the analytics page read them. - webAnalyticsEventsQuery: top event names by firings + distinct sessions, rollup/raw pair with the usual web_events fallback; own filter excluded - `eventName` page filter: one SessionId semi-join against the custom rows, applied to every query on the page (KPIs, chart, pages, 12 breakdowns) - Events card (5th in the grid), sidebar Event section, URL param + chip - builder fixtures + regenerated SQL baseline, parity e2e cases
🍁 Maple PR previewNote Preview resources were removed when this pull request closed. Final commit |
Makisuo
added a commit
that referenced
this pull request
Aug 21, 2026
Carry the Events card + eventName filter (#565) onto the product_events rename: useWebEvents -> useProductEvents, WebEvents -> ProductEvents, withWebEventsFallback -> withProductEventsFallback, and mount the new eventsResult on the analytics view beside the funnels tab. sql-catalog baseline regenerated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a custom events card to the Web Analytics page and an
eventNamepage filter.webAnalyticsEventsQuery: toptrack()event names by firings (count()) with distinct sessions (uniq(SessionId)); rollup (web_events.Kind='custom') / raw (session_events.Type='custom') pair behind the existingwithWebEventsFallback.host/pagePathnarrow to the page the event fired on (same reading as Pages); replays dimensions reach it via the existing semi-join; its owneventNamefilter is excluded so the alternatives stay listed.eventNamefilter on the sharedWebAnalyticsFilters: a singleSessionId IN (SELECT … WHERE Kind='custom' AND EventName = ?)semi-join, appended toreplaysWhereand bothnavigationWhere*(so KPIs, chart, pages and all 12 breakdown branches narrow).matchingSessionsSubquerystrips it to avoid nesting the same semi-join twice.navigationConditions*generalised intoeventConditions*(kind).WebAnalyticsEventsRequest/Response,POST /web-analytics-events, handler; registry pairwebAnalyticsEvents/…Raw.viewsLabelonBreakdownDimension), sidebar "Event" section (hidden when nothing is tracked),?eventName=URL param +event:<name>chip,webAnalyticsEventsResultAtom.catalog.sqlbaseline; parity e2e gains the events query plusevent/event+pathfilter cases (seed already has custom rows).Why
track()events were ingested and rolled up intoweb_eventsbut nothing outside the per-session replay rail aggregated them.Reviewer notes
eventNamesemi-join is inlined into every branch of theall-dimensions-filteredbreakdown union (same shape as the navigation semi-join); the newwebAnalyticsEventsQuery:semi-joinedfixture shows own-filter exclusion.?eventName=onboarding_started, narrowed sessions 86.3K → 528 across KPIs/sidebar, kept all rows in the card with the selection highlighted; chip clears it.bun typecheck,sql-catalog.test.ts,src/chunit tests green. ClickHouse parity e2e not run locally — CIclickhouse-schema-e2eshould cover it.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.