The Marketing Cloud Connector only sync's email subscription data back to Sales Cloud (SC) under specific circumstances defined here
How can we ensure that these remained updated correctly if a lead or contact is unsubscribed in either system with their opt-out status reflected in the other system?
Best Answer
SC update MC to unsubscribe where HasOptedOutOfEmail = True
Description:
A process to synchronise Salesforce Leads & Contacts where they are subscribed in MC but have been unsubscribed in SC
Requires building an automation with the following steps:
create Data Extensions
A. Create a data extension (QueryTargetDataExtension) to collect the resulting from the query below.
B. Create a data extension (LoggingDataExtension) to log the results, including status and timestamp
SQL query
The query finds all leads & contacts where they are subscribed in MC but have been unsubscribed in SC where HasOptedOutOfEmail = 'TRUE'
This script retrieves the data from the targeted data extension, cycles through each row, unsubscribes from MC and creates a log on the on the LoggingDataExtensionId
MC update SC with unsubscribe status where HasOptedOutOfEmail = False
Description:
A process to synchronise Salesforce Leads & Contacts where they are unsubscribed in MC but subscribed in SC
Requires building an automation with the following steps:
create Data Extensions
A. Create a data extension (QueryTargetDataExtension) to collect the resulting from the query below.
B. Create a data extension (LoggingDataExtension) to log the results, including status and timestamp
SQL query
The query finds all leads & contacts where they are unsubscribed in MC but have been subscribed in SC where HasOptedOutOfEmail = 'FALSE'
This AMPscript retrieves the data from the targeted data extension, cycles through each row, updates the related record in SC with HasOptedOutOfEmail = 'True' and creates a log on the LoggingDataExtensionId
A SSJS script is required to execute the AMPscript within the automation. This is because AMPscript cannot be directly added to an automation