How Does Data Model Work in Salesforce Marketing Cloud?
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 Extension | What each row represents | Example fields |
|---|---|---|
| CustomerProfile | One customer | ContactKey, EmailAddress, FirstName, Language |
| Orders | One order | OrderID, ContactKey, OrderDate, Total |
| CampaignAudience | One selected customer for a campaign | ContactKey, 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
Contact Builder connects related data
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:
- Find customers who placed an order in the last 30 days.
- Match those orders to customer profiles using ContactKey.
- Apply the campaign’s selection and exclusion rules.
- 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.






