Integrating Salesforce Marketing Cloud with Sitecore Forms

When our marketing team asked our Sitecore Development team if you could send data from Sitecore Forms to Salesforce Marketing Cloud (SFMC), our developers were pretty sure they could do it. Mainly because there already are quite some Sitecore connectors for SFMC, but also because Salesforce has a well-documented API.

After looking at the out of the box (OOTB) Sitecore-Salesforce connectors, it turned out that there was no solution for Sitecore Forms integration that met the requirements of our marketing team. Fortunately, there were some ready to use libraries (fuelSDK) that would make custom development go faster when digging deeper into Salesforce API. However, nothing is as simple as it looks, we figured out soon enough.

Integration SFMC and Sitecore Forms

Why we made it

Using the fuelSDK was definitely the right direction, as you only need to add some authentication details from SFMC to the config to get it going. Coding with it is also pretty straightforward, as you first transform the data from the Sitecore form fields and the mapped data extension columns, and then use the fuelSDK to get it into SFMC.

The issue resides in the data mapping, which is the process of getting the right form field to the right data extension column. This involves interdisciplinary teamwork as the marketing team has to tell the development team exactly what the mapping should look like, so the developers can code it. You can’t make any typos or other mistakes, as SFMC will not accept the data if you try to add it to a non-existing column or use the wrong type of data (Boolean, string, …).

The issue becomes bigger, as our developers figured out that they had to do this for various Sitecore Forms, and that those forms need to exist and be exactly the same on all the environments we were using (DEV, ACC, PRD).

Our marketing team wasn’t happy when they heard that the code had to be changed and deployed to all the environments whenever they wanted to change something in the SFMC data extension or a Form that could impact the mapping. That’s why we looked at the possibility to develop a custom Save Action module for Sitecore Forms.

A flexible module

The module had to be easy to use for both the developer and the content editor or marketer. For that reason, the developer only has to add the config for fuelSDK (which contains authentication details on SFMC) and install the module in Sitecore. From that point on, He is not required anymore, and the content editor can get started. They’ll only need to add the “Send to SFMC” save action to the form and configure the mapping inside the application.

We also wanted to build a Sitecore integrated application where marketers and content editors can easily do the mapping themselves, which can be achieved with Sitecore SPEAK. You can find the result below. If you open the dashboard application, you’ll see a list of all the configured bindings in a Sitecore UI:


This gives the content editor the impression that they haven’t left Sitecore. If you would open a binding or create a new one, a screen like this one will open:


Here, a content editor can configure the binding and the mapping. First, a form must be chosen from the available forms, displayed in a dropdown. Next, the editor can select a data extension (this is the place where you’ll be putting the data into) from a dropdown, filled with all the data extensions in SFMC. This makes the life of the editor easier and avoids mistakes.

As soon you picked a form and a data extension, the bottom part of the screen will change. Here you can pick a field for each column in the selected data extension from a dropdown. All columns are fetched for you, just like all available fields. Fields are grouped in four categories: calculated fields (for example: timestamp, website language, …), form fields (fields from the selected form) and two groups for xdb related fields (only available when xdb is enabled).

If you would like to trigger an event in SFMC, you can easily do so by checking the corresponding checkbox and configuring the event name as well as the contact ID.

By fetching all the data straight from Sitecore and SFMC, we avoid typos and increase simplicity. When you save and publish it, you are ready for testing.

As we focused on simplicity, we also decided to use Sitecore items for storing the bindings, which resulted in the amazing feature that allows you to migrate your bindings by packaging and installing it on other environments.

An internal project for you to use

Here at The Reference, we strive to make our clients achieve their business goals by combining expertises from many different fields. By building this module first for internal purpose as an experiment, and by making it available for free, we hope it will help you easily migrate your Sitecore Forms data from Sitecore to SFMC.

Do you want to learn more about how we achieved this? These blog posts might offer you some more insights:

Salesforce Marketing Cloud and its many features

Building our own Salesforce SFMC integration with Sitecore Forms

Download the module


Don't miss out

It's more than digital, it's your business
The Reference is nothing without its customers. Carglass is the car window repair and replacement specialist for whom we've built a fully responsive Sitecore website. Read more about this client.