Integrating UserIQ and Salesforce
Benefits to Integration
UserIQ connects to the SFDC Bulk API endpoint to perform a Bi-directional sync of data on an hourly basis. This integration allows you to PULL data from Salesforce objects into UserIQ for a deeper insight into targeted messaging and analytics. You are also able to PUSH UserIQ data such as activity and usage back into Salesforce so all of your accounts/contacts in SFDC have a complete picture.
Before setting up a Salesforce Integration
**Important-Integration will not work unless** The value you are passing for the account_id/user_id via the UserIQ tracking code must exists in Salesforce, and matches exactly with the data in UserIQ. This is very important as we sync based on account_id at an account level and based on user_id at a user level. If for any reason, the account_id equivalent data in your Salesforce does not match with the data in UserIQ, the sync will not happen.
Example: You have a customer in your platform, Acme, you pass the account name and ID for Acme to UserIQ as account_name = Acme, account_id = 1234. In Salesforce, under the account Acme, you have to have a field with the value "1234". The name of the field is not important, but it must contain the same value that you are passing to UserIQ for the account_id.
Connecting UserIQ to Salesforce
The first part of setting up the integration requires having an admin login to Salesforce.
- To start the integration process, login to your Salesforce.com instance. (Please note, you need to be a Salesforce administrator with permissions to the metadata API to successfully complete this process)
- Click on the Cog Icon in the upper right hand corner, then click Setup.
- On the left navigation menu, click the > Apps menu, then App Manager
- In the right corner of the App Manager list, click on the New Connected App button.
- In the Basic Information section, add the following details:
Connected App Name
- Click on the “API (Enable OAuth Settings)” checkbox:
For Production, copy and paste the following value as the Callback URL:
Or for Sandbox, copy and paste the following value as the Callback URL:
- Click the Save button
Note: There will be a delay of 2-10 minutes after you click save before the Connected App is ready for users. Wait 10 minutes before continuing on to the final steps.
From this screen you need to copy and save both the Consumer Key and Consumer Secret, you will need these when configuring the integration in UserIQ.
After copying both the Consumer Key and Consumer Secret, click the Manage button at the top of the page.
Click the Edit Policies button
Verify the following IP Relaxation and Refresh Token Policy settings are as follows.
Save any changes you have made and return to the UserIQ app.
- In UserIQ, click on your Initials in the upper right corner, click Site Settings, on the Tabs across the top left, click Integrations, click Salesforce on the left.
- Enter the Salesforce Client ID (Consumer Key) and Client Secret found on the Connected App page for UserIQ in Salesforce. Click the pencil icons to the right.
Enter the both values and click the check marks to the right to save the credentials.
- Click Connect to Salesforce
* If you are connecting to a Sandbox instance of SFDC, toggle the Use Sandbox to green
After clicking Connect To Salesforce, you will be redirected to a login page
Again, you need Admin privileges.
Enter your credentials and click Log In
Depending on your security configuration, you will see a verification screen for two factor authorization - enter your code
You will now see a screen requesting access, click Allow
You should now be redirected back to the Integration page, if the page is blank, navigate back to Site Settings, Integrations, Salesforce
You should now see a Connected flag in green
- Now click the Settings tab and configure Salesforce Account/User Settings
a. Choose if you want to sync Account data or User data or both under the first drop down
b. Choose which way to sync data - to UserIQ, to SFDC, or both under the second drop down
- Toggle Enable Data Sync to blue
- Now click the Sync tab to configure which Salesforce Fields to Sync with UserIQ
a. Choose which Salesforce Object - Account or User
i. If you want to do both User and Account, they need to both be set up separately
ii. Click the link Add Mapping Field, then select a field from the available options in the dropdown. If the selected Salesforce field data type is “lookup“, it means it references another Salesforce object. In this scenario UserIQ syncs in the name of the corresponding record.
* Please note that you need to set the value that you are passing for Account Id as the mapping key for Account level and User Id as the mapping key for User/Contact level. Then toggle the Mapping Key to green next to the Field in SFDC that contains the matching value.
Select a Mapping Field
Give the field a name under the UserIQ Column (this is how it will appear in UserIQ) and click Save
If this is the Mapping Key (there can only be 1), toggle to blue next to the field. There is no limit to the number of fields you pull in from Salesforce. Click the link to continue adding fields.
- If you are configuring outbound sync to Salesforce, which allows you to push any fields you have passed to UserIQ over to Salesforce. This option is at the bottom of the Sync tab
You will need to set the variable scope of the Custom Variable to the correct scope so they are available at the appropriate level, meaning the field will appear under either the Account tab or the User tab on the Sync page.
b. Next, under the Integration Sync settings at the bottom click the Add New Outbound Field, then under the drop down on the left, select the fields you setup under Custom Variables.
* See the schema below for a list of fields
*See below for the official documentation link on how to retrieve your User ID and Secret ID