Skip to content

👉 Join our Discord community.

How Does Data Model Work in Salesforce Marketing Cloud?
348 views

How Does Data Model Work in Salesforce Marketing Cloud?

View favourites

A data model is how you organize your data and connect it to your contacts.

In Salesforce Marketing Cloud Engagement, a clear data model helps you choose the right audience, use customer details in messages, and build journeys that use the right information.

The main parts are Contact Key, Data Extensions, and Contact Builder relationships.

Contact Key identifies the contact

Contact Key is the unique value used to identify a contact. In Email Studio, the same value is called Subscriber Key.

Use a stable ID, such as a customer ID, and keep it consistent across channels. An email address is usually a poor choice because it can change.

For example, if a customer changes their email address, their customer ID can stay the same.

Marketing Cloud Engagement does not automatically merge contacts created under different keys. Using different keys for the same person can create separate contact records. Salesforce Contact Builder best practices

Data Extensions store the data

A Data Extension is a table with rows and columns. It can store customer details, orders, preferences, or an audience for a campaign.

Keep customer details and records of customer activity in separate tables.

Data ExtensionWhat each row representsExample fields
CustomerProfileOne customerContactKey, EmailAddress, FirstName, Language
OrdersOne orderOrderID, ContactKey, OrderDate, Total
CampaignAudienceOne selected customer for a campaignContactKey, EmailAddress, OfferCode

A customer can have one profile row and many order rows. The ContactKey field connects their orders to their profile.

Contact Key and primary key have different jobs

Contact Key identifies the contact. A primary key identifies a unique row in a Data Extension.

In CustomerProfile, ContactKey can be the primary key because each customer has one row.

In Orders, OrderID can be the primary key. ContactKey appears on every order, but it must allow repeated values because one customer can place several orders.

For a sendable Data Extension, also set the send relationship so the correct field maps to Subscriber Key. This is separate from choosing the table’s primary key. Salesforce Data Extension setup

In Contact Builder’s Data Designer, you define how Data Extensions relate to a contact and to each other.

For example:

  • One contact has one customer profile.
  • One contact has many orders.

These relationships let features such as Journey Builder access related Contact Data. They do not clean up duplicate records or correct mismatched IDs. The values in the linked fields must match.

SQL builds campaign audiences

SQL Query Activities select data from Data Extensions and save the results into another Data Extension.

For example, a query can:

  1. Find customers who placed an order in the last 30 days.
  2. Match those orders to customer profiles using ContactKey.
  3. Apply the campaign’s selection and exclusion rules.
  4. Save the audience into CampaignAudience.

The SQL query defines its own joins. A relationship created in Contact Builder does not replace the join conditions in your query.

Journey Data and Contact Data serve different purposes

Journey Builder can use two types of data:

  • Journey Data keeps the values passed in when the contact entered the journey.
  • Contact Data reads the values available when the journey evaluates them.

Suppose a customer enters a journey with a loyalty tier of Silver, then becomes Gold.

Journey Data still shows Silver for that entry. Contact Data can show Gold once the related data has been updated.

Choose based on whether your rule needs the original value or the current value. Salesforce Journey and Contact Data guide

Prepare personalization data before sending

If an email needs a customer’s latest order, preferred store, and offer, prepare those values before the send where possible.

A CustomerMessaging Data Extension could hold one row per contact with those fields. The email can then read the prepared values instead of calculating everything during sending.

AMPscript is suitable for most email personalization. More complex content does not automatically require SSJS. Salesforce recommends AMPscript for many cases where each subscriber receives different content.

Always provide a fallback when a value or matching row is missing.

What to check before using the data

Before running a campaign, check that:

  • The same person uses the same Contact Key across your data sources.
  • Primary keys match what each row represents.
  • Related fields contain matching IDs.
  • Audience queries return the expected contacts and number of rows.
  • Journey rules use the right type of data.
  • Personalization handles missing values.
  • Required data updates finish before the campaign starts.

Oh hi there đź‘‹
I have a SSJS skill for you.

Sign up now to get an SSJS skill that can be used with your AI companion

We don’t spam! Read our privacy policy for more info.

Share With Others

The author
Marcel Szimonisz Platinum

Marcel Szimonisz

Marketing Automation Consultant

I specialize in solving marketing technology challenges, automating processes, and turning ideas into practical solutions with Salesforce Marketing Cloud and Adobe Campaign. Through MarTechNotes, I share technical guides and insights that make complex topics easier to understand

Latest badges
Weekend Regular Weekend Regular Profile Complete Profile Complete Simple Start Simple Start 5 Day Streak 5 Day Streak First Comment First Comment

Your email address will not be published. Required fields are marked *

Get exclusive tips, scripts and news

Choose your topics

We don’t spam! Read our privacy policy for more info.

Similar posts

Add to this article

Share your experience

Your contribution

Article history

What changed