Skip to main content

Overview

The report_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.
If the metric is formula-only, source_table should be null.

source_column

The exact column in source_table to pull values from. For derived metrics like ROAS, you can specify the calculation directly:
For derived system metrics (ROAS, CPA, CPC, CTR), you can set source_column as conv_value / cost. Also add the formula field (e.g., 2/3) for footer calculations.

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

The report_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_id and agency_id
  • Soft Delete & Auditis_deleted plus timestamps ensure traceability
  • Metrics + Dimensionsis_dimension differentiates grouping dimensions from value metrics