LogoLogo
  • Contributing to RudderStack
  • Destination_Name
  • LICENSE
  • RudderStack Docs
  • docs
    • FAQ
    • Identity Resolution
    • Home
    • cloud-extract-sources
      • ActiveCampaign Source
      • Bing Ads
      • Chargebee
      • Common Settings
      • Facebook Ads
      • Freshdesk
      • Google Ads Source
      • Google Analytics
      • Google Search Console
      • Google Sheets
      • Cloud Extract Sources
      • Intercom v2
      • Intercom
      • Mailchimp
      • Marketo
      • Mixpanel
      • NetSuite
      • Pipedrive
      • QuickBooks
      • Salesforce Pardot
      • Sendgrid Source
      • Stripe Source
      • Xero
      • Zendesk Chat
      • Zendesk
      • hubspot
        • HubSpot Data Model and Schema Information
        • HubSpot
      • salesforce
        • Salesforce
        • Schema Comparison: RudderStack vs. Segment
    • connections
      • Connection Modes: Cloud Mode vs. Device Mode
    • data-governance
      • Data Governance
      • RudderTyper
      • Data Governance API
      • RudderTyper
      • tracking-plans
        • Tracking Plans
        • Tracking Plan Spreadsheet
    • data-warehouse-integrations
      • Amazon Redshift
      • Azure Data Lake
      • Azure Synapse
      • ClickHouse
      • Databricks Delta Lake
      • Google Cloud Storage Data Lake
      • Google BigQuery
      • Identity Resolution
      • Warehouse Destinations
      • Microsoft SQL Server
      • PostgreSQL
      • Amazon S3 Data Lake
      • Snowflake
      • FAQ
      • Warehouse Schema
    • destinations
      • Destinations
      • Webhooks
      • advertising
        • Bing Ads
        • Criteo
        • DCM Floodlight
        • Facebook App Events
        • Facebook Custom Audience
        • Facebook Pixel
        • Google Ads (gtag.js)
        • Google AdWords Enhanced Conversions
        • Google Adwords Remarketing Lists (Customer Match)
        • Advertising
        • LinkedIn Insight Tag
        • Lotame
        • Pinterest Tag
        • Reddit Pixel
        • Snap Pixel
        • TikTok Ads
      • analytics
        • Amplitude
        • AWS Personalize
        • Chartbeat
        • Firebase
        • FullStory
        • Google Analytics 360
        • Google Analytics
        • Heap.io
        • Hotjar
        • Analytics
        • Indicative
        • Keen
        • Kissmetrics
        • Kubit
        • Lytics
        • Mixpanel
        • Pendo
        • PostHog
        • Quantum Metric
        • Singular
        • adobe-analytics
          • Adobe Analytics Heartbeat Measurement
          • Mobile Device Mode Settings
          • Web Device Mode Settings
          • E-commerce Events
          • Adobe Analytics
          • Setting Up Adobe Analytics in RudderStack
        • google-analytics-4
          • Cloud Mode
          • Device Mode
          • Google Analytics 4
          • Setting up Google Analytics 4
        • profitwell
          • ProfitWell
          • Cloud Mode
          • Device Mode
      • attribution
        • Adjust
        • AppsFlyer
        • Branch
        • Attribution
        • Kochava
        • TVSquared
      • business-messaging
        • Business Messaging
        • Intercom
        • Kustomer
        • Slack
        • Trengo
      • continuous-integration
        • Visual Studio App Center
        • Continuous Integration
      • crm
        • Delighted
        • HubSpot
        • CRM
        • Salesforce
        • Variance
        • Zendesk
      • customer-data-platform
        • Customer Data Platform
        • Segment
      • error-reporting
        • Bugsnag
        • Error Reporting
        • Sentry
      • marketing
        • ActiveCampaign
        • AdRoll
        • Airship
        • Appcues
        • Autopilot
        • Blueshift
        • Braze
        • CleverTap
        • Customer.io
        • Gainsight PX
        • Gainsight
        • Marketing
        • Iterable
        • Klaviyo
        • Leanplum
        • Mailchimp
        • Marketo Lead Import
        • Marketo
        • MoEngage
        • Ometria
        • Pardot
        • Post Affiliate Pro
        • Qualtrics
        • SendGrid
        • Salesforce Marketing Cloud
        • Userlist
        • drip
          • Cloud Mode
          • Device Mode
          • Drip
          • Setting Up Drip in RudderStack
      • productivity
        • Google Sheets
        • Productivity
      • storage-platforms
        • Amazon S3
        • DigitalOcean Spaces
        • Google Cloud Storage
        • Storage Platforms
        • Azure Blob Storage
        • MinIO
        • Redis
      • streaming-platforms
        • Amazon EventBridge
        • Amazon Kinesis Firehose
        • Amazon Kinesis
        • Azure Event Hubs
        • BigQuery Stream
        • Confluent Cloud
        • Google Pub/Sub
        • Streaming Platforms
        • Apache Kafka
      • tag-managers
        • Google Tag Manager
        • Tag Managers
      • testing-and-personalization
        • Algolia Insights
        • Candu
        • Google Optimize
        • A/B Testing & Personalization
        • LaunchDarkly
        • Monetate
        • Optimizely Full Stack
        • Optimizely Web
        • Split.io
        • Statsig
        • VWO (Visual Website Optimizer)
    • get-started
      • RudderStack Cloud vs. RudderStack Open Source
      • Glossary
      • Get Started
      • RudderStack Architecture
    • reverse-etl
      • Amazon Redshift
      • Amazon S3
      • ClickHouse
      • FAQ
      • Google BigQuery
      • Reverse ETL
      • PostgreSQL
      • Snowflake
      • common-settings
        • Importing Data using Models
        • Importing Data using Tables
        • Common Settings
        • Sync Modes
        • Sync Schedule
      • features
        • Airflow Provider
        • Features
        • Models
        • Visual Data Mapper
    • rudderstack-api
      • Data Regulation API
      • HTTP API
      • RudderStack API
      • Personal Access Tokens
      • Pixel API
      • Test API
      • api-specification
        • Application Lifecycle Events Specification
        • API Specification
        • Video Events Specification
        • rudderstack-ecommerce-events-specification
          • Browsing
          • Coupons
          • E-Commerce Events Specification
          • Ordering
          • Promotions
          • Reviewing
          • Sharing
          • Wishlist
        • rudderstack-spec
          • Alias
          • Common Fields
          • Group
          • Identify
          • RudderStack Event Specification
          • Page
          • Screen
          • Track
    • rudderstack-cloud
      • Audit Logs
      • Dashboard Overview
      • Destinations
      • RudderStack Cloud
      • Live Events
      • Connection Modes: Cloud Mode vs. Device Mode
      • Sources
      • Teammates (User Management)
      • connections
        • Adding a Destination
        • Connections
    • rudderstack-open-source
      • Control Plane Setup
      • RudderStack Open Source
      • installing-and-setting-up-rudderstack
        • Developer Machine Setup
        • Docker
        • Data Plane Setup
        • Kubernetes
        • Sending Test Events
    • stream-sources
      • App Center
      • AppsFlyer
      • Auth0
      • Braze
      • Customer.io
      • Extole
      • Event Stream Sources
      • Iterable
      • Looker
      • PostHog
      • Segment
      • Shopify
      • Webhook Source
      • rudderstack-sdk-integration-guides
        • Client-side Event Filtering
        • SDKs
        • AMP Analytics
        • Cordova
        • .NET
        • Go
        • Java
        • Node.js
        • PHP
        • Python
        • React Native
        • Ruby
        • Rust
        • Unity
        • SDK FAQs
        • rudderstack-android-sdk
          • Adding Application Class
          • Flushing Events Periodically
          • Android
        • rudderstack-flutter-sdk
          • Flutter SDK v1
          • Flutter v2
          • Flutter
        • rudderstack-ios-sdk
          • iOS
          • tvOS
          • watchOS
        • rudderstack-javascript-sdk
          • Data Storage in Cookies
          • Detecting Ad-blocked Pages
          • JavaScript
          • JavaScript SDK Enhancements
          • JavaScript SDK FAQs
          • Querystring API
          • Quick Start Guide
          • Version Migration Guide
          • consent-managers
            • Consent Managers
            • OneTrust
    • transformations
      • Access Token
      • FAQ
      • Transformations
      • Transformations API
    • user-guides
      • User Guides
      • administrators-guide
        • Troubleshooting Guide
        • Alerting Guide
        • Bucket Configuration Settings for Event Backups
        • Configuration Parameters
        • Event Replay
        • High Availability
        • Horizontal Scaling
        • Administrator's Guides
        • Infrastructure Provisioning
        • Monitoring and Metrics
        • Okta SSO Setup
        • OneLogin SSO Setup
        • RudderStack Grafana Dashboard
        • Software Releases
      • how-to-guides
        • How to Use Custom Domains
        • How to Develop Integrations for RudderStack
        • How to Configure a Destination via the Event Payload
        • How to Filter Events using Different Methods
        • How to Filter Selective Destinations
        • How to Submit a Pull Request for a New Integration
        • How-to Guides
        • How to Debug Live Destination Events
        • How to Use AWS Lambda Functions with RudderStack
        • create-a-new-destination-transformer-for-rudder
          • Best Practices for Coding Transformation Functions in JavaScript
          • How to Create a New Destination Transformation for RudderStack
        • implement-native-js-sdk-integration
          • How to Add a Device Mode SDK to RudderStack JavaScript SDK
          • How to Implement a Native JavaScript SDK Integration
        • rudderstack-jamstack-integration
          • How to Integrate RudderStack with Your JAMstack Site
          • How to Integrate Rudderstack with Your Angular App
          • How to Integrate Rudderstack with Your Astro Site
          • How to Integrate Rudderstack with Your Eleventy Site
          • How to Integrate Rudderstack with Your Ember.js App
          • How to Integrate Rudderstack with a Gatsby Website
          • How to Integrate Rudderstack with a Hugo Site
          • How to Integrate Rudderstack with Your Jekyll Site
          • How to Integrate Rudderstack with Your Next.js App
          • How to Integrate Rudderstack with Your Nuxt.js App
          • How to Integrate Rudderstack with Your Svelte App
          • How to Integrate Rudderstack with Your Vue App
      • migration-guides
        • Migrating from Blendo to RudderStack
        • Migrating Your Warehouse Destination from Segment to RudderStack
        • Migration Guides
        • Migrating from Segment to RudderStack
  • src
    • @rocketseat
      • gatsby-theme-docs
        • text
          • Home
Powered by GitBook
On this page
  • Getting started
  • Connection settings
  • Identify
  • Identifying a potential lead
  • Updating custom fields in Salesforce
  • Updating Salesforce objects
  • Supported mappings
  • FAQ
  • Which Salesforce Edition should I use to access the API?
  • Where do I obtain the Security Token?
  • How do I check the number of Salesforce API calls left for the day?
  • What if I don't include 'Salesforce': true in my identify call?
  • Contact us

Was this helpful?

  1. docs
  2. destinations
  3. crm

Salesforce

Step-by-step guide to set up Salesforce as a destination in RudderStack.

PreviousCRMNextVariance

Last updated 3 years ago

Was this helpful?

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 lets you identify your leads in Salesforce without having to use the REST APIs.

Find the open-source transformer code for this destination in the .

Getting started

It is recommended that you create a new Salesforce account to use with RudderStack. This will protect any confidential information present in your existing Salesforce account. However, this is entirely optional. You can also use your existing account to configure Salesforce as a destination.

To create a new account, go to Setup > Administration Setup > Users > New User and select System Administrator as the profile type. This should give RudderStack the required permissions to access the API.

Before configuring Salesforce as a destination in RudderStack, verify if the source platform is supported by referring to the table below:

Connection Mode

Web

Mobile

Server

Device mode

-

-

-

Cloud mode

Supported

Supported

Supported

To know more about the difference between cloud mode and device mode in RudderStack, refer to the guide.

Once you have confirmed that the source platform supports sending events to Salesforce, follow these steps:

  1. From your , add the source. Then, from the list of destinations, select Salesforce.

  2. Assign a name to your destination and click on Next.

Connection settings

To configure Salesforce as a destination in RudderStack, you need to specify the following settings:

  • User Name: Enter your Salesforce username in this field.

  • Password: Enter the password associated with the Salesforce account.

  • Security Token: Enter your Salesforce security token.

  • Map Rudder Properties to Salesforce Properties: This setting is enabled by default and allows you to map the RudderStack event properties to the corresponding Salesforce fields.

  • Sandbox mode: Enable this setting if you are using a Sandbox environment for the integration.

  • Use contact ID for converted leads: Enable this setting if both the lead and contact field mappings are the same.

Identify

Identifying a potential lead

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

rudderanalytics.identify('userid', {
  name: 'Alex Keener',
  title: 'Mr.',
  email: 'alex@example.com',
  company: 'Google Inc.',
  phone: '+1-202-555-0146',
  rating: 'Hot',
  city: 'New Orleans',
  postalCode: '90002',
  country: 'US',
  street: 'Blue Gum Street',
  state: 'LA'
}, {
  'integrations': {
    'Salesforce': true
  }
});

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

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

When you make an identify call with a set of user traits, RudderStack will update the appropriate record in Salesforce depending on whether it is a lead or a contact using its lead or contact ID.

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.

Updating custom fields in Salesforce

For example, if you want 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 the casing is consistent . For example, if the custom fields are created in the camel case, then the traits must be sent to RudderStack in the camel case only.

Updating Salesforce objects

RudderStack looks for the key externalId under context and determines the Salesforce object type by removing the part Salesforce- from the field type. Further, it makes a PATCH request if there is an id present in the request to update the record. Otherwise, a new record is created.

You can pass multiple object types in a single request and RudderStack will create that many requests to Salesforce.

rudderanalytics.identify('123456',
    {
      FirstName: "John",
      LastName: "Gibbs",
      Email: "john@peterson.com"
    },
    {
      externalId: [
        {
          type: "Salesforce-Contact",
          id: "sf-contact-id"
        }
      ]
    });

In the example above, RudderStack updates the Contact object in Salesforce with id as sf-contact-id and sends the traits object to Salesforce.

By default, RudderStack creates a Lead object in Salesforce and maps the traits to it, as mentioned above. For other objects, RudderStack does not modify the traits; they are sent to Salesforce as it is.

Supported mappings

RudderStack supports and maps the event properties to several standard fields in Salesforce, as listed in the following table:

RudderStack property
Salesforce standard field

address.accuracy / accuracy

Accuracy

company.annualRevenue

AnnualRevenue

address.city / city

City

company.name / company

Company

address.country / country

Country

address.countryCode / countryCode

CountryCode

convertedAccountId

ConvertedAccountId

convertedContactId

ConvertedContactId

convertedDate

ConvertedDate

convertedOpportunityId

ConvertedOpportunityId

createdById

CreatedById

createdAt / createddate

CreatedDate

description

Description

email

Email

emailBouncedDate

EmailBouncedDate

emailBouncedReason

EmailBouncedReason

firstName

FirstName

geocodeAccuracy

GeocodeAccuracy

id

Id

company.industry

Industry

individualId

IndividualId

isConverted

IsConverted

isDeleted

IsDeleted

isUnreadByOwner

IsUnreadByOwner

jigsaw

Jigsaw

jigsawContactId

JigsawContactId

lastActivityDate

LastActivityDate

lastModifiedById

LastModifiedById

lastModifiedDate

LastModifiedDate

lastName

LastName

lastReferencedDate

LastReferencedDate

lastViewedDate

LastViewedDate

address.latitude / latitude

Latitude

LeadSource

LeadSource

address.longitude / longitude

Longitude

masterRecordId

MasterRecordId

name

Name

company.employee_count

NumberOfEmployees

ownerId

OwnerId

phone

Phone

photoUrl

PhotoUrl

address.postalCode / postalCode

PostalCode

rating

Rating

salutation

Salutation

address.state / state

State

address.stateCode / stateCode

StateCode

status

Status

address.street / street

Street

systemModstamp

SystemModstamp

title

Title

website

Website

FAQ

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 Salesforce edition. You must have either the Enterprise, Unlimited, Developer, or Performance editions to access the API.

Where do I obtain the Security Token?

How do I 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 then be able to see a field called API Requests, Last 24 Hours, which contains the number of API 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 does not send any identify calls to Salesforce by default. If you don't include 'Salesforce':true in your identify call payload, the call will be simply ignored.

Contact us

For more information on the Salesforce security token, refer to the guide.

For more information on the Salesforce Sandbox mode, refer to the guide.

RudderStack lets you get the leads from your website or mobile app into Salesforce through the call.

If you wish to update custom fields in Salesforce using RudderStack, make sure that you first create those fields in Salesforce before sending the data through RudderStack. For more information, refer to the guide.

As the requireslastName and company to be present, absence of either of these fields will result in RudderStack automatically appending the 'n/a' to both the fields - even if they have been specified in some previous request.

You can create or update any using the identify event. To specify the object type, follow the schema below.

Follow this for more information.

You can find your security token under Setup > Personal Setup > My Personal Information > .

For queries on any of the sections covered in this guide, you can or start a conversation in our community.

Salesforce
GitHub repository
RudderStack Connection Modes
RudderStack dashboard
Salesforce Help
Salesforce Help
identify
Salesforce Help
Salesforce Leads API
Salesforce object
Salesforce help article
Reset My Security Token
contact us
Slack
Salesforce connection settings