# Salesforce Sales & Service Cloud

Didomi allows you to push your lead and contact data to both Salesforce Sales Cloud and Service Cloud, while collecting user preferences through Didomi Preference Management.

💡 You only need to set up a single integration to sync both Sales Cloud and Service Cloud with Didomi.

{% hint style="info" %}
Make sure you have your Salesforce Sales and Service Cloud premium feature enabled. [Contact our support](mailto:support@didomi.io) team to learn more.
{% endhint %}

### Step #1 - Fetch your Salesforce API credentials

1. Log in to your [Salesforce Developer Portal](https://developer.salesforce.com/)
2. Go to Apps > App Manager and click "New Connected App"
3. Fill in the form to create the Didomi integration app
4. In "API (Enable OAuth Settings)", make sure that:
   1. "enable OAuth Settings" is selected
   2. "Selected OAuth Scopes" has Full access (full) selected\ <br>

      <figure><img src="https://support.didomi.io/hs-fs/hubfs/Screenshot%202023-10-31%20at%2010-04-59-png.png?width=523&#x26;height=787&#x26;name=Screenshot%202023-10-31%20at%2010-04-59-png.png" alt=""><figcaption></figcaption></figure>
5. Click Save, then Continue.
6. Click on "Manage Consumer Details".<br>

   <figure><img src="https://support.didomi.io/hs-fs/hubfs/Screenshot%202023-10-31%20at%2010-35-10-png.png?width=504&#x26;height=783&#x26;name=Screenshot%202023-10-31%20at%2010-35-10-png.png" alt=""><figcaption></figcaption></figure>
7. Obtain your Client ID and Secret, which will be used in [Step#2](#step-2-enable-your-didomi-salesforce-integration) below.

   <figure><img src="https://support.didomi.io/hs-fs/hubfs/Screenshot%202023-10-31%20at%2010-35-22-png.png?width=508&#x26;height=327&#x26;name=Screenshot%202023-10-31%20at%2010-35-22-png.png" alt=""><figcaption></figcaption></figure>

### Step #2 - Enable your Didomi-Salesforce integration

Once your connected app is created in the Salesforce Developer portal, you can proceed to finalize your integration config in the Didomi Console.

Navigate to the [Didomi Console,](https://console.didomi.io) click on the **Marketplace module** in the left menu, then follow these steps:

**Settings**

1. Add the Client ID and Client Secret previously collected in [Step #1](#step-1-fetch-your-salesforce-api-credentials) above.
2. Add your token URL: this is the base URL of the authentication endpoint of your Salesforce server.
   1. For example, if your authentication URL is: <https://my-domain.sandbox.my.salesforce.com/services/oauth2/token>
   2. Then only insert the base URL like this: **<https://my-domain.sandbox.my.salesforce.com>**
3. Select which Salesforce object you would like Didomi to synchronise consent data to: Contact or Lead.<br>

   <figure><img src="https://support.didomi.io/hs-fs/hubfs/Screenshot%202023-10-31%20at%2010-11-06-png.png?width=486&#x26;height=677&#x26;name=Screenshot%202023-10-31%20at%2010-11-06-png.png" alt=""><figcaption></figcaption></figure>
4. Click on "Save Settings".

{% hint style="info" %}
If you are willing to synchronise both Leads and Contact preferences within the same Didomi organization, please [contact our support](mailto:support@didomi.io) to get a new integration config.
{% endhint %}

**Options**

* Upsert mode: by enabling this option, you authorise Didomi to create new Leads/Contacts while pushing user preferences to Salesforce.
  * If Upsert mode is enabled: Didomi will check if the organization\_user\_id (provided when the user submits their preference on Didomi's Preference Management widget) matches the email address of a Lead/Contact. If not, Didomi will create a new Lead/Contact in Salesforce database on your behalf.

**Mapping**

{% hint style="info" %}
Make sure your Salesforce Lead/Contact attributes are already created in Salesforce before you start the Mapping step.
{% endhint %}

![](/files/5pFlHlcOjkEluxWVYPC3)

* For each purpose/preference/preference value, select the corresponding Salesforce Lead/Contact property from the Dropdown (scroll or search by name).

![](/files/AvFOvsXwWvEIL1dKIlfb)

There are some rules when it comes to mapping Didomi properties with Salesforce properties:

* Purpose -> Boolean
* Preference -> string
* Preference value -> Boolean

Learn more about the Didomi - Salesforce Sales & Service Cloud integration in our [Developer documentation](https://developers.didomi.io/integrations/third-party-apps/preference-management-platform-integrations/salesforce-sales-and-service-cloud).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.didomi.io/integrations/customer-relationship-manager-crm/salesforce-sales-and-service-cloud.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
