Data Cloud • Consent Management • Data Transformation

Salesforce Data Cloud Consent Synchronization

A sandbox proof of concept that turns Salesforce Lead and Contact email opt-out data into standardized marketing consent in Data Cloud while honoring duplicate-email scenarios.

Business Problem

The same email address can exist on multiple Salesforce Lead and Contact records. Relying on a single record can create inconsistent consent decisions when one record is opted out and another is not.

Solution

Built a Data Cloud batch transformation that combines Lead and Contact source data, normalizes email addresses, applies an any-opt-out-wins rule, and maps the result into the Communication Subscription Consent data model for marketing email consent.

Architecture

Salesforce Lead + Contact Source DLOs Batch Data Transform Salesforce Email Consent DLO Communication Subscription Consent DMO

Business Rule

  • If any matching Lead or Contact is opted out, the effective consent becomes OPT_OUT
  • Only when all matching Salesforce records are unchecked does the effective consent become OPT_IN
  • Consent is evaluated by normalized email so duplicate Lead and Contact records resolve consistently

How It Was Built

  • Appended Lead and Contact source DLO records into one transform path
  • Normalized email using lowercase and trim logic
  • Converted Email Opt Out into a numeric flag and aggregated by email
  • Used the maximum opt-out flag so any opted-out record wins
  • Joined the effective consent result back to each original Lead or Contact row
  • Wrote the result to a transformed consent DLO and mapped it to Communication Subscription Consent

Validation

The proof of concept was tested with one Contact and two Leads sharing the same email address. Opting out the Contact caused all three Data Cloud consent records to resolve to OPT_OUT. Unchecking the Contact again returned all three records to OPT_IN because the two Leads were already unchecked.

Business Impact

This design gives Data Cloud a consistent effective consent state across duplicate Salesforce records, reduces conflicting marketing preferences, and creates a reusable pattern for future consent channels.

Production Considerations

  • The current proof of concept uses source refresh plus batch transformation and is not real-time
  • Production scheduling should remove the need for manual refresh or transform execution
  • Future enhancements can include Salesforce checkbox write-back and phone-channel consent such as Do Not Call