Salesforce as a customer engagement platform
Salesforce is a cloud-based platform that offers CRM solutions for sales, marketing, and customer service.
To use Salesforce as a customer engagement platform:
- Configure the Live Agent.
- Create a channel.
- Connect the customer engagement platform to the inbound channel.
- Set up the transfer to the agent in the script.
Configure the Live Agent
Log in to your Salesforce account as the account administrator. Open the Settings tab. You will need the following data to create a channel.
API Endpoint
Click Setup > Feature Settings > Service > Chat > Chat Settings and copy the Chat API Endpoint field value. For example:
https://d.la1-c1-cdg.salesforceliveagent.com/chat
Organization ID
Organization ID is the organization identifier in Salesforce.
You can find the value under Settings > Company settings > Company Information or using the following link:
https://<account address>/lightning/setup/CompanyProfileInfo/home
Deployment ID
Deployment ID is the chat deployment identifier required to send reports.
Click Setup > Settings > Deployment ID. You can find the value under Service Setup > Channels > Chat > Deployments > Edit. Copy the value on the edit page in the Deployment Code box. For example:
liveagent.init(
'https://d.la1-c1-cdg.salesforceliveagent.com/chat',
'573B00000005KXz', // Copy this Deployment ID
'00DB00000003Rxz' // Do not copy this value: this is the Organization ID
);
Button ID
Button ID is the identifier of the button to open the Live Agent chat.
Click Service Setup > Channels > Chat > Chat Buttons & Invitations > Edit. Copy the value on the edit page in the Chat Button Code box. For example:
<a id="liveagent_button_online_5733X000000TdOA">
<!-- From here, copy 5733X000000TdOA -->
</a>
Create a channel
Go to the platform, click Channels > Customer engagement platforms > Connect channel in the control panel. Select Salesforce.
Fill in the fields:
- Name — specify a name for the channel or keep the default one.
- Enter the previously copied values for API Endpoint, Organization ID, Deployment ID, and Button ID.
Click Create.
Connect the channel
Select an already created inbound channel to which you want to connect the customer engagement platform. Switch to the inbound channel editing window. Select the platform from the list in the Agent field and click Save.
Transfer to the agent
$response.replies.push
in order to transfer to the agent in the script.Specifying the agent group
By default, clients are transferred to the agent group whose Button ID was specified when the channel was created.
If you need to redefine the agent group where the request will be transferred, add the destination
key in the switch
reply. Set its value to the Button ID of the required agent group.
Send additional data to Salesforce
To send additional data when transferring to the agent in the script, add the customData
parameter to the switch
response.
customData
is a JSON where you can pass prechatDetails
and prechatEntities
entities in the ChasitorInit
query format.
ChasitorInit
requestHow to use
$response.replies.push({
type: "switch",
closeChatPhrases: ["/closeLiveChat", "Close the chat"],
firstMessage: $client.history,
lastMessage: "We’ll be waiting for your return!",
destination: "5733X000000TdOA",
customData: {
"prechatDetails": [
{
"label": "Email",
"value": $client.email,
"transcriptFields": [
"Email__c"
],
"displayToAgent": true
},
{
"label": "ResponseTypeList",
"value": $client.channel,
"entityMaps": [
{
"entityName": "Case",
"fieldName": "ResponseTypeList__c"
}
],
"transcriptFields": [
"ResponseTypeList__c"
],
"displayToAgent": true
}
],
"prechatEntities": [
{
"entityName": "Case",
"showOnCreate": true,
"saveToTranscript": "Case",
"entityFieldsMaps": [
{
"fieldName": "Status",
"label": "Status",
"doFind": false,
"isExactMatch": false,
"doCreate": true
},
{
"fieldName": "Origin",
"label": "Origin",
"doFind": false,
"isExactMatch": false,
"doCreate": true
},
{
"fieldName": "ResponseTypeList__c",
"label": "ResponseTypeList",
"doFind": false,
"isExactMatch": false,
"doCreate": true
}
]
}
]
}
});