offdataai
Salesforce · data model template

Salesforce Marketing Attribution data model

Kimball warehouse for Salesforce marketing (Campaign, CampaignMember, Account Engagement/Pardot engagement, Campaign Influence). A campaign-member transaction fact, a prospect-engagement transaction fact, and a Campaign Influence allocation fact spanning multiple attribution models for multi-touch ROI and pipeline attribution.

Salesforce campaigns and Account Engagement (Pardot) migrated to a cloud warehouse: campaign membership, prospect engagement, and multi-touch Campaign Influence that allocates opportunity revenue across touches under first/last/even/W-shaped/U-shaped/time-decay/data-driven models, over conformed Account, Contact, and Campaign dimensions for marketing ROI, pipeline sourced/influenced, and channel-mix 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.

KimballSalesforceGDPRCCPACAN-SPAM
10
tables
84
columns
12
relationships
4
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

campaign_responseengagementattributionconformed_dimensions

Design decisions

  • Campaign Influence modelled as an allocation fact keyed by model

    Multi-touch attribution credits one opportunity across many campaign/contact touches; storing one row per (opportunity, campaign, contact, model) with an influence_pct lets every attribution model be compared side-by-side without rebuilding the fact.

  • Engagement events separated from campaign membership

    Pardot emits high-volume open/click/form/page-view events at a finer grain than CampaignMember status; isolating them keeps the membership funnel clean while still supporting content and scoring analysis.

  • Lead and Contact unified into one person dimension

    A prospect is a Lead before conversion and a Contact after; conforming both into dim_contact with a person_type flag lets pre- and post-conversion engagement be attributed to the same individual.

  • Consent flags carried on the person dimension

    CAN-SPAM/GDPR require honouring email opt-out and tracking consent; surfacing has_opted_out_of_email and do_not_track on dim_contact keeps suppression auditable directly in the warehouse.

Tables in the Salesforce Marketing Attribution 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 (3)

fct_campaign_member

Grain: one row per CampaignMember (a person's membership in a campaign)

Transaction-grain campaign membership for reach, response rate, and member-status funnels.

ColumnTypeKeys
campaign_member_keybigintPK
campaign_keybigint
contact_keybigint
date_keybigint
campaign_member_idvarchar
member_typevarchar
member_statusvarchar
responded_date_keybigint
has_respondedboolean
member_countsmallint

fct_engagement_activity

Grain: one row per Pardot prospect engagement event

Transaction-grain prospect-engagement events for content performance and scoring trends.

ColumnTypeKeys
engagement_activity_keybigintPK
contact_keybigint
campaign_keybigint
channel_keybigint
date_keybigint
activity_idvarchar
activity_typevarchar
asset_namevarchar
engagement_score_deltadecimal
grade_changevarchar
activity_countsmallint

fct_campaign_influence

Grain: one row per (opportunity, campaign, contact, attribution model) credit allocation

Campaign Influence allocation fact — distributes opportunity revenue across touches per model.

ColumnTypeKeys
campaign_influence_keybigintPK
campaign_keybigint
account_keybigint
contact_keybigint
attribution_model_keybigint
date_keybigint
opportunity_idvarchar
touch_positionvarchar
influence_pctdecimal
attributed_amountdecimal
attributed_pipelinedecimal
is_primary_campaign_sourceboolean

Dimension tables (5)

dim_date

Grain: one row per calendar day

ColumnTypeKeys
date_keybigintPK
full_datedateBK
month_numbersmallint
quartersmallint
yearsmallint
week_of_yearsmallint
is_business_dayboolean

dim_account

Grain: one row per Salesforce Account per SCD2 version

SCD type 2

ColumnTypeKeys
account_keybigintPK
salesforce_idvarcharBK
account_namevarchar
account_segmentvarchar
industryvarchar
billing_countryvarchar
is_target_accountboolean

dim_contact

Grain: one row per Contact/Lead (person) per SCD2 version

SCD type 2

ColumnTypeKeys
contact_keybigintPK
salesforce_idvarcharBK
person_typevarchar
first_namevarcharPII
last_namevarcharPII
emailvarcharPII
job_titlevarchar
personavarchar
lead_sourcevarchar
countryvarchar
has_opted_out_of_emailboolean
do_not_trackboolean

dim_campaign

Grain: one row per Salesforce Campaign per SCD2 version

SCD type 2

ColumnTypeKeys
campaign_keybigintPK
salesforce_idvarcharBK
campaign_namevarchar
campaign_typevarchar
parent_campaign_idvarchar
statusvarchar
start_datedate
end_datedate
budgeted_costdecimal
actual_costdecimal
is_activeboolean

dim_user

Grain: one row per Salesforce User (campaign/record owner)

ColumnTypeKeys
user_keybigintPK
salesforce_idvarcharBK
user_namevarcharPII
marketing_teamvarchar
regionvarchar
is_activeboolean

Lookup tables (2)

dim_channel

Grain: one row per marketing channel

ColumnTypeKeys
channel_keybigintPK
channel_namevarcharBK
channel_groupvarchar
is_paidboolean

dim_attribution_model

Grain: one row per Campaign Influence attribution model

ColumnTypeKeys
attribution_model_keybigintPK
model_namevarcharBK
model_descriptionvarchar
is_data_drivenboolean

Relationships

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

  • fct_campaign_member.campaign_key → dim_campaign (many-to-one)
  • fct_campaign_member.contact_key → dim_contact (many-to-one)
  • fct_campaign_member.date_key → dim_date (many-to-one)
  • fct_engagement_activity.contact_key → dim_contact (many-to-one)
  • fct_engagement_activity.campaign_key → dim_campaign (many-to-one)
  • fct_engagement_activity.channel_key → dim_channel (many-to-one)
  • fct_engagement_activity.date_key → dim_date (many-to-one)
  • fct_campaign_influence.campaign_key → dim_campaign (many-to-one)
  • fct_campaign_influence.account_key → dim_account (many-to-one)
  • fct_campaign_influence.contact_key → dim_contact (many-to-one)
  • fct_campaign_influence.attribution_model_key → dim_attribution_model (many-to-one)
  • fct_campaign_influence.date_key → dim_date (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