Episode 8. Handling Opt-ins /outs in the SFDC CRM and extending it with SF Marketing cloud — Salesforce Consents Management

Itsmem0h1t
7 min readFeb 18, 2021

Agenda: I am sure you might have come across a very common topic, Consents Management and have gone through the lengthy discussions in order to define this from business and technology perspective.

ignore my handwriting :D

What I would like to do is, share my experience working with different customers and share insights on how we handled it and will describe a way to capture and manage consents using Salesforce data model.

Exciting! let’s get started..

Design: Handling opt ins / outs & managing consents in SFDC CRM

This is depicted on the left side in the picture where (part 1 of the solution)

  • The idea was to handle consents for multiple channels & capture per channel,
  • SFDC is to be considered as a system of record / master for consents & their preferences.
  • Salesforce was chosen for the purpose to store and manage consents using Salesforce Consents data model
  • Lastly, the intention was to update the master (first) and make the information flow to other downstream systems (e.g. SFMC/ Adobe etc.) present in the customer IT landscape

Key elements to capture were, Who provided consent, Which channels they consented to being contacted on, via which channel address, and What type of content they consented to

Typical questions to deal with while consulting:

  1. How to capture Consents ? — Answer: A customer facing micropage / landing page built custom on SFDC CRM, hosted on a public branded community interface or you could also use force.com site.
  2. Where to store them — SFDC standard Consents Objects.
  3. How to sync consents data with other downstream systems- SFMC via. Marketing cloud connect so that customer preferences are respected for any commercial emails/ communications sent from marketing cloud and if he/she has decided not to receive any of your comms. or marketing emails we as brand need to ensure that we don’t send anything.
  4. And, Lastly manage the lifecycle of the consents (usually there exists requirement as well to ensure the consents given by customers are valid only for certain period and before they becomes stale they need to ensure that the customer consent are renewed)

How we did it :

In Salesforce CRM cloud,

  1. we designed a custom lightning component (you can also do VF page), host it on public community, the URL should be unique , hashed unique for each customer.
  2. Include this url as link behind unsubscribe in all commercials, or in the 1st of the series of the emails , you email you trigger when the customer is onboarded.
  3. Customer receives the email and can click on unsubscribe which would bring the customer on our custom landing page where he/she can unsubscribe, customer makes a selection and information flows back to SFDC CRM.
  4. In SFDC, Contact point type consent record is updated , reflecting timestamp when customer unsubscribed and any optional information.
  5. Next, time is to sync this information (data change) to other systems.
  6. For SFDC → SFMC : Option: relying on Marketing Cloud connector(recommeneded), data can easily be shared in SFMC with polling frequency of 15mins (minimum) under synchronized data extension, (for this this you need to setup in marketing cloud- simple steps like ordinary objects under Contact builder — Data sources )
  7. Once the data flows under synchronized data extension, we need to design one automation which runs hourly or daily as well, picks the delta from sync data extension and add them to the custom suppression list also if you are in parent business unit, you can sync this change under all subscribers lists as well. (outcome: suppression list + all subscribers)
  8. Also, for SFDC → SFMC : Option 2 (real time api callout). If you need this really real-time sync, this can also be done by making an api callout from SFDC → SFMC for the contacts (subscribers in Sfmc) which exists in marketing cloud. Important thing to note here is that, a contact should exists under “all subscribers” list otherwise you won’t be able to update their subscribers status in marketing cloud. lastly Also as part of MC connect featuring there are also few custom actions available on contact & lead in Sales CRM to unsubscribe & resubscribe actions which requires manual user action but that can also be utilised if the use case is not that major and for less volume rather than investing any effort on writing an api callout (any customization)

sync is important to ensure,

a) all subscribers statuses in marketing cloud are always in sync to prevent any inconsistencies

b) on Sfmc side: you can maintain separate suppression/ exclusion lists by ingesting status results from synchronized data extension.

LASTLY: Always best to use the any platform capabilities standard to its maximum rather than including any custom overhead for anyone.

9. If there are any other systems in the scope, you can trigger outbound messaging from SFDC to post the data change notification at the endpoint which external system can consume. (please see outbound messaging) SFDC → Sync with other external systems or best is have a middleware/ integration layer in between to orchestrate this data to other systems.

At the end this is how one can visualize,

Customer subscribes / unsubscribes → update happens in SFDC → update flows in SFMC or other external systems.

Option 2: Managing Consents in SFMC

Now coming to part 2 of solution , This is depicted on the right hand side of the pic above

Important: The idea here is to handle only email type consents and customer subscriptions related to different publications of a brand (newsletter, commercials, Ads etc.) NOT other any channels.

Pre case: Customer using SFDC CRM and SFMC marketing cloud

How we realise the solution :

  1. We used the standard subscription center from marketing cloud as a place to manage all customer facing subscriptions.
  2. Next, since this is the out of the box SFMC feature, no effort to invest in building a custom page, however if required you can create / design a microsite in Web studio under marketing cloud & use combination of Amp-script to handle the data update in SFMC (recommended it gives you more flexibility to customize the brand look and feel)
  3. Now we trigger an email from SFMC, including standard unsubscribe link, customer receives the email, → clicks on the link and lands on to the standard subscription center and can choose to unsubscribe.
  4. SFMC would be updated, please check the status reflection under All subscribers for the respective customer.
  5. Next, to sync the change from SFMC → SFDC CRM, how ? Option 1: we designed again an automation which monitors the delta change under all subscribers, queries Unsubscribe data view and all the audiences in the custom data extension ,
  6. Next, our automation job picks up the list or your data extension and starts updating status in SFDC using amp script or SSJS updateSingle SalesforceObject and similar methods. this automation can be set to run on a nightly basis.
  7. Or Option 2: To update SFMC → SFDC is rely on the “email opt out” (powerful )field on contact &lead which will always be updated automatically by marketing cloud connect product in the other direction & to complete the journey once the “email opt out field” is updated , we can have a process builder inside monitoring any change on email opt out which will also immediately synchronize the change on “contact point type consent” record so that your central consents pool is always updated and Consents remain the real source of truth for all consents given per channels
  8. At this step SFDC side would be updated as well and if here is a need to updated other systems you can use outbound messaging or platform events.

On a side note: please ensure the SF record 18 digit is to be used as a subscriber key or ID to make your life easy.

At the end this is how one can visualize

Customer unsubscribes → update in SFMC → update in SFDC→ update the other external system (if required)

That’s all !! For question to decide which approach to use. Let’s try to include maximum possible factors a) How many systems are involved in the landscape who needs this info. b) type of consents to be captured (channels is it just email or other offline + digital channels as well)

Hope you enjoyed reading. You can read more about consents in general here:

Also check out this super usefel utility from Salesforce labs to manage and capture consents in salesforce CRM

https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000FMiVQUA1

Thanks — Mohit

--

--