Skip to main content

Module model

Module model 

Source
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§

AnalyticsEvent
One analytics hit — a pageview (HTTP beacon on load) or an engagement record (written when the visitor’s WebSocket disconnects, or via an unload fallback beacon). Append-only. No raw IP is ever stored — only a coarse country resolved from a CDN header.

Functions§

ensure_table
Create cms_analytics_event (+ its indexes) if absent. Idempotent; called per tenant at boot.