Showing posts with label Live Agent. Show all posts
Showing posts with label Live Agent. Show all posts

Sunday, 17 June 2018

Einstein Bots | How to Setup Einstein Bot | Summer 18



Recently we did one online session on "Einstein Bots". If you are looking for recording you can check here. To use Einstein Bots you need to enable Live Agent. If you have not done it yet, read this Post for Live Agent.


Let see how to configure the same.

Step 1) Enable the Einstein Bot.
Click on Setup->Service -> Service Cloud Einstein -> Einstein Bot Then Enable it.



Step 2) Accept Term and Condition .


Step 3) Enable Live Agent Option.
Click on "Deployment Channels"


click on edit button and enable the bot for Live Agent.


Step 4) Create a new Bot.
Click on "New" button from My Bots section.



And then follow below step :-



Step 5) Lets create Dialogs.

Click on Dialog Menu from the Einstein Bots Builder.



Then Click on + button to create "New Dialogs".


All Set . Now Create a question


Click on Question icon and enter your question like below screen.


Then add new Slot.


Add some more question :)


NOTE:- Add some Choice this time. Click on "Add Choice" button.


Lets Create some rule to Response to end user. Click on Rule button from below screen.


Add Condition and action

NOTE:- I created one more Dialog "Pizza Restaurants". You can create the one more rule for Chinese as well.

Save your changes after click on save button


Step 6) Now set Dialogs in welcome bots.
Click on "Welcome" option from Einstein Bots Builder.


Step 7) Save and Activate.



Now you can test your Einstein Bot from Live Agent.





If you want to see the recording of out Apex Hour click here. Thanks Shruti for a great Demo in Salesforce Apex Hours.


Please check below post if you want to call apex class in bots

Einstein Bots with Apex Class | How to Call Apex Class From Einstein Bots




Capture.JPG  @amit_sfdc    #SalesforceApexHours    @ApexHours

Thanks
Amit Chaudhary

Monday, 27 February 2017

Pre-Chat form for Live Agent | Post Chat / Pre Chat Form in salesforce | Live Agent Tutorial

Pre-Chat Form in Live Agent

In live Chat this is very common to collect some information about customer like name ,email and phone number. Providing that information to agent before they connect with customer will increase the agent's productivity as they won't have to ask those questions manually. With the help of Pre-Chat Form we can collect the same information for agent prior to start the chat.

Please follow below step to setup the Pre -Chat Form in Live Agent.

Step 1) Setup the live Agent
Please check below post how to configure Live Agent

http://amitsalesforce.blogspot.com/2016/08/live-agent-implementation-setting-up.html
URL:- http://amitsalesforce.blogspot.com/2016/08/live-agent-implementation-setting-up.html
PPT :- https://www.slideshare.net/AmitChaudhary112/live-agent

Step 2) Create Pre-Chat form code.


<apex:page showHeader="false">

<!-- This script takes the endpoint URL parameter passed from the deployment page and makes it the action for the form -->
<script type='text/javascript'>
(function() {
function handlePageLoad() {
var endpointMatcher = new RegExp("[\\?\\&]endpoint=([^&#]*)");
document.getElementById('prechatForm').setAttribute('action',
decodeURIComponent(endpointMatcher.exec(document.location.search)[1]));
} if (window.addEventListener) {
window.addEventListener('load', handlePageLoad, false);
} else { window.attachEvent('onload', handlePageLoad, false);
}})();
</script>

<h1>Live Agent Pre-Chat Form</h1>

<!-- Form that gathers information from the chat visitor and sets the values to Live Agent Custom Details used later in the example -->
<form method='post' id='prechatForm'>
    First name: <input type='text' name='liveagent.prechat:ContactFirstName' id='firstName' /><br />
    Last name: <input type='text' name='liveagent.prechat:ContactLastName' id='lastName' /><br />
    Email: <input type='text' name='liveagent.prechat:ContactEmail' id='email' /><br />
    Phone: <input type='text' name='liveagent.prechat:ContactPhone' id='phone' /><br />
    Issue: <input type='text' name='liveagent.prechat:CaseSubject' id='subject' /><br />

<!-- Hidden fields used to set additional custom details -->
    <input type="hidden" name="liveagent.prechat:CaseStatus" value="New" /><br />
    
    <!-- This example assumes that "Chat" was added as picklist value to the Case Origin field -->
    <input type="hidden" name="liveagent.prechat:CaseOrigin" value="Chat" /><br />
    
    <!-- This example will set the Case Record Type to a specific value for the record type configured on the org. Lookup the case record type's id on your org and set it here -->
    <input type="hidden" name="liveagent.prechat:CaseRecordType" value="012D00123456789" />
    
    <!-- Used to set the visitor's name for the agent in the Console -->
    <input type="hidden" name="liveagent.prechat.name" id="prechat_field_name" />

<!-- map: Use the data from prechat form to map it to the Salesforce record's fields -->
<input type="hidden" name="liveagent.prechat.findorcreate.map:Contact" value="FirstName,ContactFirstName;LastName,ContactLastName;Email,ContactEmail;Phone,ContactPhone" />

<input type="hidden" name="liveagent.prechat.findorcreate.map:Case" value="Subject,CaseSubject;Status,CaseStatus;Origin,CaseOrigin;RecordTypeId,CaseRecordType" />

<!-- doFind, doCreate and isExactMatch example for a Contact: 
    Find a contact whose Email exactly matches the value provided by the customer in the form 
    If there's no match, then create a Contact record and set it's First Name, Last Name, Email, and Phone to the values provided by the customer -->
<input type="hidden" name="liveagent.prechat.findorcreate.map.doFind:Contact" value="Email,true" />
<input type="hidden" name="liveagent.prechat.findorcreate.map.isExactMatch:Contact" value="Email,true" />
<input type="hidden" name="liveagent.prechat.findorcreate.map.doCreate:Contact" value="FirstName,true;LastName,true;Email,true;Phone,true" />

<!-- doCreate example for a Case: create a case to attach to the chat, set the Case Subject to the value provided by the customer and set the case's Status and Origin fields -->
<input type="hidden" name="liveagent.prechat.findorcreate.map.doCreate:Case" value="Subject,true;Status,true;Origin,true;RecordTypeId,true" />

<!-- linkToEntity: Set the record Contact record, found/created above, as the Contact on the Case that's created --> 
<input type="hidden" name="liveagent.prechat.findorcreate.linkToEntity:Contact" value="Case,ContactId" />

<!-- showOnCreate: Open the Contact and Case records as sub-tabs to the chat for the agent in the Console -->
<input type="hidden" name="liveagent.prechat.findorcreate.showOnCreate:Contact" value="true" />
<input type="hidden" name="liveagent.prechat.findorcreate.showOnCreate:Case" value="true" />

<!-- saveToTranscript: Associates the records found / created, i.e. Contact and Case, to the Live Chat Transcript record. --> 
<input type="hidden" name="liveagent.prechat.findorcreate.saveToTranscript:Contact" value="ContactId" />
<input type="hidden" name="liveagent.prechat.findorcreate.saveToTranscript:Case" value="CaseId" />

<!-- displayToAgent: Hides the case record type from the agent -->
<input type="hidden" name="liveagent.prechat.findorcreate.displayToAgent:CaseRecordType" value="false" />

<!-- searchKnowledge: Searches knowledge article based on the text, this assumes that Knowledge is setup -->
<input type="hidden" name="liveagent.prechat.knowledgeSearch:CaseSubject" value="true" />

<input type='submit' value='Chat Now' id='prechat_submit' onclick="setName()"/>

<!-- Set the visitor's name for the agent in the Console to first and last name provided by the customer -->
<script type="text/javascript">
   function setName() {
    document.getElementById("prechat_field_name").value =  
        document.getElementById("firstName").value + " " + document.getElementById("lastName").value;
    }
</script>

<style type="text/css">
p {font-weight: bolder }
</style>

</form>
</apex:page>
Sample code :- https://developer.salesforce.com/docs/atlas.en-us.live_agent_dev.meta/live_agent_dev/live_agent_pre_chat_forms_code_sample.htm


Step 3) Configure the Pre-Chat code In Live Agent

1) Go to Setup -> Customize -> Live Agent --> Chat Button & Invitations


2) Edit Button setting and add VF page in Pre-Chat Form like below screen shot


3) Click Save




Related Link
1) https://developer.salesforce.com/docs/atlas.en-us.live_agent_dev.meta/live_agent_dev/live_agent_pre_chat_forms_code_sample.htm

2) https://developer.salesforce.com/docs/atlas.en-us.live_agent_dev.meta/live_agent_dev/live_agent_pre_chat_forms.htm


Thanks
Amit Chaudhary
@amit_sfdc 
 

Friday, 26 August 2016

Live Agent Implementation | Setting up live Agent in Salesforce


What is Live Agent

Now days customers expect fast replies and quick resolutions. With Live Agent web chat, We can give them quicker responses to their queries. Live Agent provide users the ability to interact with the agents through web chat to get more information about specific product or queries

Process 1) Follow below Step to Setup Live Agent 

Step 1 :- Open live Agent Setting
Customize --> Live Agent----> Live Agent Setting



Step 2:- Enable Live Agent 
Click on Enable Live Agent Chat Box and click on save button



Once you will enable the Live Agent below object will auto created in your org.
  1. Live Chat Visitors
  2. Live Chat Transcripts
  3. Live Chat Transcript Events
  4. Live Agent Sessions
  5. Live Agent Supervisor
  6. Live Agent
  7. Quick Text
Step 3:- Setup Live Agent User.

Setup--> My Setting -> Advanced User Details--> Then click on Live Agent User checkbox



Step 4:- Set Skill

Click on Setup --> Live Agent --> Skill



 Then Click on new button and setup skill like below screen



Step 5:- Upload Online and Offline Image

Upload online and offline image in "Static Resource"



Step 6:- Setup Chat Buttons & Invitations

Setup--> Customize -->Live Agent --> Chat Button & Invitation.


then click on New Button. And add all below detail


Once you will click on Save button the chat button code will come

Copy Above Script and keep with you

Step 7:- Create Deployment

Click on Setup-> Customize --> Live Agent--> Deployments


Then click on New button and provide all below detail


Then click on Save button. After Saving Deployment code will come like below


Copy the Deployment code.

Create the HTML page with Chat Button Code (Step 6) and Deployment Code.


NOTE:- First you need to copy Chat Button Code then Deployment Code.

Now you all Set with live Agent Configuration

Process 2) Now Setup the Agent Console ( Console App )


Step 1:- Open App Wizard
Setup--> Create --> App



Step 2:- Create new Console App

Click on new button then select console button


While creating the App on Step 6 select the "Include Live Agent in this App" check box like below




Now All Set. We can test the same now


Process 3) How To Test

Click on HTML page which you created in process 1 Step 7.

Once you page will open and Agent is not online the below Html page will show you offline image


Once Agent will come online from agent console then image will change on client HTML page

How Agent will come online

Step 1:- Select Live Agent Console App


Step 2) Then from the Live Agent Click on Online button



Now All Set Agent is online :)

Step 3) Refresh you HTML page
Once Agent will login the HTML will show you online image like below


Then click on Image the set session will start.



Accept chat from agent console




Thanks,
Amit Chaudhary