Gold Star Schema (v1 draft)
Gold Star Schema (v1 draft)
Mutable document. Schema version gold.v1. Grain and keys
are the contract; column lists are indicative.
Dimensions
| Table | Grain | Key | SCD | Notable columns |
|---|---|---|---|---|
dim_date |
Day | date_key |
— | calendar, fiscal period, is_closed_period |
dim_source |
Source system | source_key |
1 | name, type (crm, ads, marketing) |
dim_channel |
Marketing channel | channel_key |
1 | paid search, paid social, email, organic, direct, referral |
dim_campaign |
One row per source campaign per version | campaign_key |
2 | source, source_campaign_id, name, type, status, start/end, marketing_initiative, channel_key, valid_from/to, is_current |
dim_ad_group |
Google Ads ad group per version | ad_group_key |
2 | campaign_key, name, status |
dim_ad |
Ad per version | ad_key |
2 | ad_group_key, type, headline summary, status |
dim_keyword |
Keyword criterion | keyword_key |
2 | ad_group_key, text, match_type, status |
dim_budget |
Campaign budget per version | budget_key |
2 | amount, delivery_method, valid_from/to |
dim_ad_account |
Google Ads customer account | ad_account_key |
1 | customer_id, name, currency, time_zone, manager flag |
dim_account |
Organisation (Salesforce Account, HubSpot Company) | account_key |
2 | source, name, domain, industry, employee_band, country |
dim_person_pseudo |
Person (tokenised) | person_key (vault token, assigned at the Bronze
gate) |
2 | lifecycle_stage, lead_status, country, industry, employee_band, consent flags, first_touch_channel, created_date; no identifiers; no array columns (Direct Lake does not support them) |
bridge_person_source |
Person × source record | person_key, source_key,
source_person_token |
1 | Links one tokenised person to its tokenised Salesforce and HubSpot record ids |
dim_pipeline_stage |
Opportunity / deal stage | stage_key |
1 | source, pipeline, stage, order, is_won, is_lost |
dim_owner_team |
Team or role of a source user | owner_team_key |
1 | team, role, tokenised user key |
dim_conversion_action |
Google Ads conversion action | conversion_action_key |
1 | name, category, counting type, attribution model, click-through window days |
dim_engagement_type |
Type of engagement event | engagement_type_key |
1 | email_open, email_click, form_submit, page_view, call, meeting, task |
Facts
| Table | Grain | Keys | Measures | Partition | Rebuild unit |
|---|---|---|---|---|---|
fact_ad_performance_daily |
ad account × campaign × ad group × keyword (nullable) × device × date | date_key, ad_account_key, campaign_key, ad_group_key, keyword_key | impressions, clicks, cost_micros, interactions, all_conversions (unsegmented) | month | date × ad account (replaceWhere on date) |
fact_ad_conversions_daily |
ad account × campaign × ad group × conversion action × date | date_key, ad_account_key, campaign_key, ad_group_key, conversion_action_key | conversions, conversions_value, view_through_conversions | month | date × ad account (replaceWhere on date) |
fact_spend_daily |
ad account × campaign × date | date_key, ad_account_key, campaign_key, budget_key | cost, budget_amount, pacing_ratio | month | date × ad account |
fact_lead_funnel |
person × stage entry | person_key, stage_key, campaign_key (first touch), channel_key, date_key | days_in_previous_stage, count (1) | month | date |
fact_deal_stage_event |
opportunity/deal stage transition | deal token, stage_key (from/to), account_key, owner_team_key, date_key | amount, probability | month | date |
fact_engagement |
engagement event | person_key, engagement_type_key, campaign_key, date_key, source_key | count (1), link_domain, email_id | month | date |
fact_form_submission |
submission | person_key, form id, campaign_key, date_key | count (1) | month | date |
business_event |
detected important change (the outbox) | event_id = hash(event_type, subject_key, source_version, rule_version), event_type, subject_type, subject_key, occurred_at, observed_at, source batch | before/after summary (generalised), rule_version | day | MERGE insert-if-absent on event_id (CDF on) |
Conversion metrics are kept in their own fact because segmenting by conversion action multiplies rows; mixing them with impressions and clicks in one grain would inflate the non-conversion metrics.
Allow-list enforcement
The Gold jobs write only the columns listed in
gold_v1_allowlist.json (kept with the code). Any Silver
column not in the allow-list is dropped. Identifiers were already
replaced by vault tokens at the Bronze gate (ADR
6), so this is schema governance, not privacy enforcement;
aggregation-only tables (no person_key) are the default for
the broad audience.
Semantic model mapping
- Model
Marketing Performance:fact_ad_performance_daily,fact_ad_conversions_daily,fact_spend_daily, campaign/ad hierarchy dims,dim_conversion_action,dim_date,dim_ad_account. Open to all report consumers. - Model
Funnel & Engagement:fact_lead_funnel,fact_deal_stage_event,fact_engagement,dim_person_pseudo,dim_account,dim_campaign. Person-level tables restricted to themarketing-analystrole by object-level security; aggregate measures exposed to all. - Both models: Direct Lake on OneLake, reframed by the pipeline after each Gold run (ADR 9).
Versioning
Breaking changes (type change, key change, removed column) bump the
schema version and create a new table name suffix; consumers are
notified through a schema.changed business event and the adding a source change
process. Additive columns do not bump the version.