Organizations use customer relationship management (CRM) tools, such as Salesforce and marketing automation platforms (MAPs), such as Campaign Studio, hand-in-hand. This enables them to collect and store data about their customers and leads. Such organizations use the data to provide personalized marketing from Campaign Studio based on the data stored in Salesforce.
Note
The Salesforce plugin that is available in Campaign Studio, uses API calls, which are only available in the following Salesforce editions:
Enterprise
Unlimited
Developer
Performance
If you don’t use one of these Salesforce editions, you can’t use the plugin.
Using the Salesforce plugin has two primary phases:
In order to use Salesforce with Campaign Studio, you must have a connected app in Salesforce. You may use an existing Salesforce user for the connection. However, Acquia recommends that you create a Salesforce user exclusively for connecting with Campaign Studio.
Note
You can use a regular user’s profile to connect to Campaign Studio. However, the user name used for authentication is the user name that displays for any changes to data pushed from Campaign Studio to Salesforce.
To create a connected app:
Access your Salesforce account.
Navigate to Setup > Apps > App Manager and click New Connected App.
For more information, see Configure Basic Connected App Settings.
In the Basic Information section:
Under the API (Enable OAuth Settings) section:
Select the Enable OAuth Settings check box.
In Callback URL, specify the Callback URL displayed in the plugin
configuration modal in your Campaign Studio instance. The format is: https://subdomain.company.com/integration/Salesforce2/callback
, where subdomain.company.com
is replaced with your custom domain.
Clear the Use digital signatures check box.
In Selected OAuth Scopes, select the following scopes and move them to the Selected OAuth Scopes section on the right.
Save the changes.
On the App Manager page, locate the row for your connected app.
Click the down arrow icon in the same row and then click View.
Locate Manage Consumer Details and copy the value for Consumer Key and Consumer Secret.
You must specify these values in Campaign Studio while configuring the Salesforce plugin. For more information, see Configuring the plugin in Campaign Studio.
Note
Do not use the SalesforceSandbox instances for testing because it will generate mapping of Campaign Studio IDs to SalesforceSandbox IDs. Contacts cannot be mapped in multiple ACS instances because the corresponding sf-object-id associated with the contact in Campaign Studio is unique.
To configure the plugin in Campaign Studio:
Sign in to your Campaign Studio account.
Click the Settings icon on the top right corner and select Plugins.
Click the Salesforce plugin. If you see two Salesforce options, select the second one (the first one is the legacy Salesforce plugin).
Under the Enabled/Auth section, perform the following steps:
Leave the plugin unpublished until you’re fully ready to turn on the plugin and start syncing data.
Note
Whenever you make any configuration changes, such as field mapping changes, ensure that you unpublish and re-publish the plugin for all the changes to take effect.
Specify the values for Consumer id and Consumer secret. You’ll get these values from Salesforce apps page. For more information, see Creating a connected app in Salesforce.
Click Authorize App. A new window will open, where you can log in to Salesforce using the user credentials you’ve created for the plugin to use.
Note
If you try to authorize Campaign Studio immediately after creating the connected app in Salesforce, you might get an error. If so, wait for ~10 minutes and try again. The connected app and its credentials need time to propagate.
Under the Features section, perform the following steps:
To enable sync between Salesforce and Campaign Studio, select the Sync objects between Campaign Studio and this integration check box. If this box is not selected, data doesn’t sync regularly. However, you’ll be able to use specific actions in campaigns, forms, and point triggers to push contacts from Campaign Studio to Salesforce. Once pushed, no data for those contacts will be updated in Campaign Studio if this check box is not selected.
In Select the objects to sync with Campaign Studio, select the specific objects for which you want to get data synced between Salesforce and Campaign Studio. Available objects are Leads, Contacts, and Accounts.
In Start synchronization from date, select the date from which data needs to be synced between Salesforce and Campaign Studio. Any records updated in Salesforce more recently than the selected date will be pulled into and synced with Campaign Studio. If you change this date after first publishing the plugin, you’ll need to unpublish and re-publish the plugin for the sync to start from the new date.
(Optional) In Fetch only records for SF Lead that meet the following condition, select either Include or Exclude to include or exclude leads who have either a positive or negative value on a boolean field in Salesforce.
Note
If you don’t want to sync all leads, you may want to create a field in Salesforce for Sync to Campaign Studio and update that to a positive value using a Salesforce workflow, based on the criteria you determine.
(Optional) In Push only records for Contacts that meet the following condition, select either Include or Exclude to include or exclude leads who have either a positive or negative value on a boolean field in Salesforce.
Note
If you do not want to sync all contacts, then create a field in Salesforce for Sync to Campaign Studio and update that to a positive value using a Salesforce workflow, based on the criteria you determine.
(Optional) Repeat the above step for Company.
(Optional) Repeat the above step for contact and account objects.
To display a lead or contact’s Campaign Studio activity timeline on the record in Salesforce, set the Upload Campaign Studio activities toggle bar to Yes. For more information, see Timeline object.
In Events to include in the activity sync, select the activity types
that you’d like to display in Salesforce, if the Upload Campaign Studio
activities toggle bar is set to Yes. For example, Email read,
Form submitted, Point gained
.
If the Salesforce account that you’re connecting to is a sandbox for testing purposes, select the This is a Sandbox account check box.
Note
For sandbox, ensure that you select this check box as sandbox logins
have different URLs, such as test.salesforce.com
.
In If your Salesforce account uses a namespace prefix, enter it here, specify your organization’s namespace prefix, if it is defined. Having a namespace prefix changes the API names for fields. Hence, if you have one, you must define it here.
Under the Lead Field Mapping section, perform the following steps:
Map the specific Campaign Studio lead to a Salesforce field. Campaign Studio automatically identifies the Salesforce fields for each of the lead objects. The fields for each object are listed alphabetically. However, you can find a specific Salesforce field by using the Filter integration fields… search bar.
From the following available options, select the direction you’d like the data to flow. To ensure that the data gets synced properly, see Field mapping validation.
Important
Repeat the above step for the Contact Field Mapping and Account Field Mapping sections. For contacts, you must map Email and Last Name. For accounts, you must map Account Name.
Under the Enabled/Auth section, set the Plugin must be enabled and authorized for this field to work toggle bar to Yes (published).
Click Apply or Save & Close.
Important
Each time you publish/re-publish the plugin, the entire sync is triggered/re-triggered. This uses API calls, which Salesforce monetizes. Once you’ve hit your API limits with Salesforce, your data stops syncing until either the limit refreshes or you pay more to increase the limit.
Within the field mapping, Campaign Studio has validations that prevent mismatched data from being synced. There are two types of validation that Campaign Studio performs:
In both cases, you can save the mapping and ignore the warning. In cases where field data can’t be synced, any other syncable data on a record is synced and the remaining data is skipped. You’ll see a notification in your Campaign Studio instance and on the individual contact record.
Note
Before you delete a custom field from Salesforce, you must remove the related field mapping from Campaign Studio to avoid losing leads/contacts.
As a Salesforce user, you might want to view a lead or contact’s engagements with marketing activities. The following two ways enable you to view activities and interactions from Campaign Studio, as a Campaign Studio user would normally see on a contact record:
By using the timeline object feature, you can view the details about activities passed from Campaign Studio to Salesforce, within Salesforce.
Important
To use this option, ensure that you set the Upload Campaign Studio activities toggle bar to Yes (under the Features tab of the Salesforce plugin configuration in Campaign Studio).
To use this feature:
Follow the steps mentioned in Creating a custom object.
Set the Label to Campaign Studio Activities and Object Name to mautic_timeline.
Save the changes.
Under the Custom Fields & Relationships section, click New to create the following custom fields with the mentioned data types:
Date/Time
Lookup(Contact)
Long Text Area(131072)
Lookup(Lead)
Number(18, 0) (External ID)
URL(255)
Text(255)
Note
Save the changes.
Update the layouts for both the lead and contact objects so that the new custom object can be viewed.
On the timeline object in the layout editor, select ActivityDate from the list of Available Fields to add it to Selected Fields and save.
Unpublish and re-publish the Salesforce plugin.
Note
Once you delete a custom field in Campaign Studio, mapping for that custom field also gets deleted from the Salesforce configuration.
If you don’t want to create a custom object in Salesforce, you can populate a field in Salesforce with a link to each record’s Campaign Studio timeline.
To do so:
Navigate to Object And Fields > Object Manager > Lead > Fields & Relationships.
Click New to create a custom field in Salesforce and name it Campaign Studio timeline
.
Campaign Studio sends the data to Salesforce as a link.
In Campaign Studio, navigate to the field mapping section (under Settings > Plugins), map the custom field that you’ve created in the first step to the Contact timeline URL field and set the direction to sync only to the integration.
Unpublish and re-publish the Salesforce plugin.
Note
To use the timeline link option, Salesforce users must be added as Campaign Studio users as well.
Once the plugin is authorized and published, you can view three Salesforce specific segment filters:
The Salesforce filters for lead and contact have operators of including/excluding with values of yes/no.
For example,
For Salesforce campaign filters, the operators are equals/not equal/empty/not empty. Once you’ve selected the appropriate operator, type the name of the Salesforce campaign that you want to use in the filter. Campaign Studio displays a list of Salesforce campaigns with matching names, and the available statuses. To include multiple campaigns and/or statuses, add multiple segment filters with the OR filters.
Campaign Studio has multiple Salesforce specific actions related to forms, campaigns, and point triggers. These actions can modify the way a record is synced with Salesforce:
All of the above actions are available as standalone form actions, campaign actions, and as point triggers. However, these actions are not available for campaign forms.
When a contact submits a form, Campaign Studio can automatically create a task for a Salesforce user to follow up or complete some other action. To get a task created in Salesforce automatically, you can use the Create Salesforce task action.
The available fields for this action are:
When a lead or contact submits a Campaign Studio form, you may want to add them to a specific Salesforce campaign and set a status within that campaign. If the lead or contact already exists in Salesforce, Campaign Studio automatically syncs with that record (based on email address) and adds the existing record to the campaign with the designated status. If there is no corresponding record in Salesforce, Campaign Studio creates a new lead and adds the lead to the campaign with the designated status.
Note
The Push to Salesforce action should only be used to add contacts to a specific Salesforce campaign and not simply to create new contacts in Salesforce if the sync is turned on with the What features of this integration should be enabled check box under Settings > Plugins. Use this action to create new contacts in Salesforce only if the sync is turned off.
The available fields for this action are:
To add a contact to multiple Salesforce campaigns, add multiple form actions.
Once a record submits a specific Campaign Studio form, you may want to remove such a record from an existing Salesforce campaign membership.
The available fields for this action are:
Based on the status of a Salesforce campaign, Campaign Studio can add or remove points from a record.
To allocate points for Salesforce records:
Sign in to your Campaign Studio account.
Go to Points > Manage Actions and click New.
In Name, indicate a name for the point action that appears in your point action list.
In Description, add more detail on the campaign status and the value in adding or removing points based on that status.
In Change points (+/-), set the number of points you’d like to add (positive number) or subtract (negative number) based on the campaign status.
In When a contact, select Salesforce campaign member change for the Salesforce-specific point action. For more information, see points.
In Select Salesforce Campaign, select the campaign that you want to use as the basis for changing points. The system populates this field with all the active campaigns in Salesforce.
In Select Salesforce Campaign Status, select the status that triggers the point addition or subtraction to the record. The system populates this field with the available statuses for the selected campaign.
Save the changes.
Once a record has the selected status on the selected campaign in Salesforce, the point action adds or subtracts the designated number of points.