Salesforce

Step-by-step guide to adding Salesforce as a destination in RudderStack

Salesforce is an industry leader in enterprise CRM. It offers a suite of enterprise applications revolving around marketing automation, customer engagement and support, application development as well as analytics.

RudderStack allows you to integrate your source to Salesforce in order to identify your leads without having to use the REST APIs.

Getting Started

Before configuring your source and destination on the RudderStack, please verify if the source platform is supported by Salesforce by referring to the table below:

Connection Mode

Web

Mobile

Server

Device mode

-

-

-

Cloud mode

Supported

Supported

Supported

Once you have confirmed that the platform supports sending events to Salesforce, perform the steps below:

Please follow our Adding a Source and Destination guide to add a source and destination in RudderStack.

  • Give a name to the destination and click on Next. You should then see the following screen:

Salesforce Connection Settings
  • Please provide your Salesforce username and password here, along with the access token. Then, click on Next. Salesforce will be enabled as a destination in RudderStack.

We recommend that you create a new Salesforce account to use it with RudderStack. This will protect any confidential information present in your existing Salesforce account. This is entirely optional, however, and you can also use your existing Salesforce account.

To create a new account, please go to Setup - Administration Setup - Users - New User and create a System Administrator profile. This should give RudderStack enough permissions to access the API.

Identify

RudderStack makes it very easy for you to get your leads from your website or mobile app into Salesforce through our identify call.

Identifying a potential lead

The following code snippet demonstrates a sample identify call in RudderStack:

rudderanalytics.identify('userid', {
name: 'John Doe',
title: 'CEO',
email: 'name.surname@domain.com',
company: 'Company123',
phone: '123-456-7890',
state: 'Texas',
rating: 'Hot',
city: 'Austin',
postalCode: '12345',
country: 'US',
street: 'Sample Address',
state: 'TX'
}, {
'integrations': {
'Salesforce': true
}
});

The above code snippet identifies a unique user based on the userid and the associated traits passed in the identify call.

It is mandatory to include 'Salesforce':true in every Salesforce integration object. As Salesforce has strict API limits, this is required in order to prevent the users from hitting their limits. By default, RudderStack does not send identify calls to Salesforce. Hence, any identify call that does not include 'Salesforce':true in its payload will be ignored.

When the identify method is called, RudderStack checks if the lead already exists using the email property. If it exists, the lead is updated with the traits passed in the identify call. If no lead exists, a new lead in Salesforce is created.

Updating custom fields in Salesforce

If you wish to update custom fields in Salesforce using RudderStack, please ensure you create those lead fields in Salesforce before you send the data through RudderStack. As lastName and company are needed by the Salesforce Leads API, absence of either of these fields will result in RudderStack automatically appending the 'n/a'string to both the fields - even if they have been specified in some previous request.

As an example, if you wish to collect a custom trait in RudderStack named newProp, create a field label named newProp. This will generate an API name as newProp__c. RudderStack automatically appends the __c to any custom trait.

Make sure you are consistent with your casing. If the custom fields are created in camelCase, please make sure sure that you send the traits to RudderStack in camelCase. If you're creating custom fields in snake_case, ensure you send the traits in the same format.

FAQs

Which Salesforce Edition should I use to access the API?

Before connecting to the Salesforce API with RudderStack, make sure you are using the right edition of Salesforce. Please follow this guide to know more about the supported editions with the API access. You must have either the Enterprise, Unlimited, Developer or Performance editions to access the API.

Where do I get the Security Token?

You can find your Security Token under Setup - Personal Setup - My Personal Information - Reset My Security Token.

If you still face any issues, feel free to contact us.

How to check the number of Salesforce API calls left for the day?

To check the number of Salesforce API calls, go to Setup - Administration Setup - Company Profile - Company Information. You should be able to see a field called API Requests, Last 24 Hours, which contains the number of APIs calls left for the day.

What if I don't include 'Salesforce': true in my identify call?

Salesforce has a very strict API limit. Moreover, RudderStack by default does not send identify calls to Salesforce. If you don't include 'Salesforce':true in your identify call payload, the call will simply be ignored.

Contact Us

If you come across any issues while configuring Salesforce with RudderStack, please feel free to contact us or start a conversation on our Discord channel. We will be happy to help you.