Overview
Thereport_data_dictionary table is the single source of truth for all metrics, dimensions, and formulas used in system-defined and custom reports. Every metric — whether pulled from a source, calculated via formula, or manually entered — is registered here.
Schema
Key Columns Explained
source_table
Specifies which database table the metric is pulled from. Only required for system metrics — formula and user metrics leave this null.
source_column
The exact column in source_table to pull values from. For derived metrics like ROAS, you can specify the calculation directly:
attribute
Defines which attribute a custom metric or dimension is built on. This enables grouping and filtering.
level
Specifies which data level a metric belongs to. The same metric (e.g., Clicks) exists at multiple levels:
The UI uses
level for filtering — when a user selects a dimension, they see all metrics at that level.Report Custom Fields
Thereport_custom_fields table maps metrics and dimensions to their associated sources.
- A system metric is always associated with one source
- A custom metric can be associated with multiple sources
- An attribute can be associated with single or multiple sources
Design Principles
- Single Source of Truth — All metrics, formulas, and dimensions originate from the data dictionary
- Extensible — Adding a new system metric only requires inserting a row
- Multi-Tenant — Metrics can be client- or agency-specific via
client_idandagency_id - Soft Delete & Audit —
is_deletedplus timestamps ensure traceability - Metrics + Dimensions —
is_dimensiondifferentiates grouping dimensions from value metrics
.png?fit=max&auto=format&n=Frm2GFbmok4D-yJA&q=85&s=93c3ebd47542af65d1cd06d8563a7f6e)