offdataai
Marketing & AdTech · data model template

Email Marketing & Automation Analytics data model

Kimball warehouse for email/marketing-automation: a transaction-grain email-event fact, an accumulating-snapshot per-recipient send fact, a list subscription-event fact, and an email-attributed revenue fact over conformed subscriber/campaign/flow/message/list dimensions. Campaign and flow keys are nullable so broadcast campaigns and automation flows share the same facts.

Email service providers and marketing-automation platforms (Klaviyo, Mailchimp, Marketo, Braze, Iterable) migrated to a cloud warehouse: email engagement events, per-recipient sends, list subscription changes, and email-attributed revenue over a conformed SCD2 subscriber dimension plus campaign, automation-flow, message/variant, and list dimensions for deliverability, engagement, list growth/churn, flow performance, and revenue analytics. It is a Kimball dimensional model: fact tables at a declared grain surrounded by conformed dimensions, ready for BI tools and a semantic layer.

KimballMarketing & AdTechGDPRCCPACAN-SPAM
10
tables
93
columns
17
relationships
3
PII columns

Opening the template creates a project with the ERD, platform-native DDL, a dbt project and documentation already generated (recommended platform: Snowflake). Edit it in plain English or on the canvas, then ship it to any supported warehouse.

Subject areas

engagementlist_healthrevenueconformed_dimensions

Design decisions

  • Campaign and flow as parallel nullable dimensions

    Every send originates from either a one-off campaign or an automation flow; carrying both as nullable FKs on the send and event facts lets broadcast and triggered email share one conformed model instead of two divergent schemas.

  • Event grain separate from per-recipient send grain

    ESPs emit many events (open/click/bounce) per recipient; an accumulating send fact gives clean open/click/conversion rates per recipient, while the event fact preserves the full raw engagement stream for funnels.

  • Subscription events modelled explicitly

    List growth, unsubscribe rate, and consent are core deliverability and compliance metrics; a dedicated subscription-event fact tracks subscribed/unsubscribed/cleaned transitions the profile snapshot loses.

  • Email-attributed revenue with an explicit attribution window

    Klaviyo/Iterable attribute orders to emails within a conversion window; storing the window and attribution type on the revenue fact makes per-flow ROI and revenue-per-recipient auditable.

Tables in the Email Marketing & Automation Analytics model

Every table with its grain, columns, types and keys. PK marks a primary key, BK a business key and PII a column classified as personal data, which gets a masking strategy by default.

Fact tables (4)

fct_email_event

Grain: one row per email engagement event

Transaction-grain email event fact for deliverability and engagement funnels.

ColumnTypeKeys
email_event_keybigintPK
date_keybigint
subscriber_keybigint
email_campaign_keybigint
flow_keybigint
message_keybigint
email_event_idvarchar
event_typevarchar
is_uniqueboolean
device_typevarchar
link_urlvarchar
event_countsmallint

fct_email_send

Grain: one row per email sent to a subscriber (accumulating snapshot)

Accumulating-snapshot send fact (one row per recipient) for open/click/conversion rates.

ColumnTypeKeys
email_send_keybigintPK
subscriber_keybigint
email_campaign_keybigint
flow_keybigint
message_keybigint
send_date_keybigint
send_idvarchar
flow_step_numbersmallint
first_open_date_keybigint
first_click_date_keybigint
open_countsmallint
click_countsmallint
is_deliveredboolean
is_bouncedboolean
is_unsubscribedboolean
is_convertedboolean
attributed_revenuedecimal
send_countsmallint

fct_subscription_event

Grain: one row per list subscription change

Transaction-grain subscription fact for list growth, churn, and consent tracking.

ColumnTypeKeys
subscription_event_keybigintPK
date_keybigint
subscriber_keybigint
list_keybigint
subscription_event_idvarchar
event_typevarchar
sourcevarchar
event_countsmallint

fct_email_revenue

Grain: one row per email-attributed order/conversion

Email-attributed revenue fact for per-campaign/flow ROI and revenue-per-recipient.

ColumnTypeKeys
email_revenue_keybigintPK
date_keybigint
subscriber_keybigint
email_campaign_keybigint
flow_keybigint
order_idvarchar
revenuedecimal
attribution_typevarchar
attribution_window_hourssmallint
items_countsmallint
revenue_countsmallint

Dimension tables (4)

dim_date

Grain: one row per calendar day

ColumnTypeKeys
date_keybigintPK
full_datedateBK
month_numbersmallint
quartersmallint
yearsmallint
day_of_weeksmallint
is_weekendboolean

dim_subscriber

Grain: one row per email subscriber per SCD2 version

SCD type 2

ColumnTypeKeys
subscriber_keybigintPK
subscriber_idvarcharBK
emailvarcharPII
first_namevarcharPII
last_namevarcharPII
countryvarchar
consent_statusvarchar
acquisition_sourcevarchar
lifetime_value_bandvarchar
is_suppressedboolean

dim_email_campaign

Grain: one row per email campaign / broadcast

ColumnTypeKeys
email_campaign_keybigintPK
campaign_idvarcharBK
campaign_namevarchar
subject_linevarchar
campaign_typevarchar
from_namevarchar
from_emailvarchar
send_datedate
audience_sizeinteger

dim_flow

Grain: one row per automation flow / journey

ColumnTypeKeys
flow_keybigintPK
flow_idvarcharBK
flow_namevarchar
flow_typevarchar
trigger_typevarchar
statusvarchar
num_stepssmallint

Lookup tables (2)

dim_message

Grain: one row per email message / variant

ColumnTypeKeys
message_keybigintPK
message_idvarcharBK
message_namevarchar
variantvarchar
subject_linevarchar
channelvarchar

dim_list

Grain: one row per list / segment

ColumnTypeKeys
list_keybigintPK
list_idvarcharBK
list_namevarchar
list_typevarchar
is_dynamicboolean

Relationships

Each relationship is a foreign key on the first table referencing the second.

  • fct_email_event.date_key → dim_date (many-to-one)
  • fct_email_event.subscriber_key → dim_subscriber (many-to-one)
  • fct_email_event.email_campaign_key → dim_email_campaign (many-to-one)
  • fct_email_event.flow_key → dim_flow (many-to-one)
  • fct_email_event.message_key → dim_message (many-to-one)
  • fct_email_send.subscriber_key → dim_subscriber (many-to-one)
  • fct_email_send.email_campaign_key → dim_email_campaign (many-to-one)
  • fct_email_send.flow_key → dim_flow (many-to-one)
  • fct_email_send.message_key → dim_message (many-to-one)
  • fct_email_send.send_date_key → dim_date (many-to-one)
  • fct_subscription_event.date_key → dim_date (many-to-one)
  • fct_subscription_event.subscriber_key → dim_subscriber (many-to-one)
  • fct_subscription_event.list_key → dim_list (many-to-one)
  • fct_email_revenue.date_key → dim_date (many-to-one)
  • fct_email_revenue.subscriber_key → dim_subscriber (many-to-one)
  • fct_email_revenue.email_campaign_key → dim_email_campaign (many-to-one)
  • fct_email_revenue.flow_key → dim_flow (many-to-one)

Related templates

All templates →
Start for $1

From requirements to AI-ready context, in one platform.

Describe your business in a conversation, start from a template or connect your own database. Your first model is ready in minutes.

Get startedBook a demo

Plans from $1/month · cancel any time