Skip to content

Comments

task(content analytics) #34710 : Fix naming and reference inconsistencies for Engagement Dashboard#34711

Open
jcastro-dotcms wants to merge 4 commits intomainfrom
issue-34710-Fix-naming-and-reference-inconsistencies-for-Engagement-Dashboard
Open

task(content analytics) #34710 : Fix naming and reference inconsistencies for Engagement Dashboard#34711
jcastro-dotcms wants to merge 4 commits intomainfrom
issue-34710-Fix-naming-and-reference-inconsistencies-for-Engagement-Dashboard

Conversation

@jcastro-dotcms
Copy link
Contributor

@jcastro-dotcms jcastro-dotcms commented Feb 20, 2026

Summary

Fixes naming inconsistencies and several correctness issues in the Engagement Dashboard analytics infrastructure (ClickHouse schema and CubeJS cube definitions).

CubeJS schema changes:

  • Renamed contextSiteIdsiteId across all four cube definitions (EngagementDaily, SessionsByBrowserDaily, SessionsByDeviceDaily, SessionsByLanguageDaily) to align with the underlying context_site_id column convention

ClickHouse schema fixes:

  • Fixed utc_time column type from DateTime to DateTime64(3,'UTC') to support millisecond-precision timestamps
  • Fixed session_states_mv aggregate functions — replaced _timestamp with utc_time across all minState, maxState, and argMaxState calls so session time windows and dimension states are correctly computed
  • Removed the redundant context_site_id String plain column from session_states; context_site_id is now exclusively tracked via its argMax aggregate state and properly materialized via argMaxMerge(context_site_id_state) in session_facts_rmv
  • Simplified session_states ORDER BY from (customer_id, cluster_id, sessionid, context_site_id) to (customer_id, cluster_id, sessionid) — site is a derived dimension, not a partitioning key
  • Extended session_facts_rmv rolling finalization window from 72 hours to 5 days to better handle late-arriving events
  • Updated now() to now64(3, 'UTC') in session_facts_rmv for consistent timestamp precision
  • Fixed content_presents_in_conversion_mv syntax — REFRESH EVERY 15 MINUTE and APPEND TO are now on separate lines for correctness
  • Added commented-out REFRESH EVERY 30 SECOND hints in session_facts_rmv and content_presents_in_conversion_mv for local development iteration
  • Normalized terminology: "rollup" → "roll-up" consistently throughout SQL comments and documentation

Test plan

  • Deploy updated ClickHouse init SQL to a local analytics environment and verify all tables and materialized views are created without errors
  • Confirm CubeJS cube definitions compile successfully and the renamed siteId dimension resolves correctly in queries
  • Ingest test events and validate that session time windows (min_ts, max_ts) and dimension states (context_site_id, user_agent, device_category, browser_family, language_id) are populated correctly in session_states and session_facts
  • Verify engagement_daily and sessions_by_*_daily roll-ups refresh on schedule and return correctly aggregated data

Fixes #34710

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Fix naming and reference inconsistencies for Engagement Dashboard

1 participant