Expand description
Analytics event model + boot-time table/index creation.
cms_analytics_event is created per tenant at boot via
CREATE TABLE IF NOT EXISTS (the same pattern as cms_form_entry).
The create-table shortcut does not emit index DDL, so the indexes
the dashboard aggregates rely on are created explicitly here.
Structs§
- Analytics
Event - One analytics hit — a
pageview(HTTP beacon on load) or anengagementrecord (written when the visitor’s WebSocket disconnects, or via an unload fallback beacon). Append-only. No raw IP is ever stored — only a coarsecountryresolved from a CDN header.
Functions§
- ensure_
table - Create
cms_analytics_event(+ its indexes) if absent. Idempotent; called per tenant at boot.