Friday, February 28, 2025

Live Agent in Salesforce

Live Agent in Salesforce is used for interacting with customers on chat. It helps agents and customers to connect with each other and share information on chat in real time without any wait.

Prerequisites for configuring Live Agent:

1.) In Live agent settings, enable live agent.
2.) The user who is using live agent in Salesforce should be Live Agent User. So In the user record of user, Live agent user should be enabled.



Configuring Live Agent

1.) In setup menu, Goto Customize -> Live Agent - > Skills
2.) Create new skill and assign it to users who has Live agent enabled.
3.) Goto Customize -> Live Agent -> Chat Buttons and Invitations.

Here we can create Buttons as well as Invitations. Buttons are like simple buttons where customers will click to initiate the chat whereas Invitations are popped up automatically on customer's screen to start the chat. Invitations are popped up based on some conditions.

3.1.) Creating a Button



Please find reference to the fields used for creating the button below:

a.) Type: Whether it is a button or Invitation
b.) Name : Name of the Buttonor Invitation
c.) Language : The language for text in the chat window
d.) Enable Customer Time-Out : Specifies whether visitor idle timeout feature is enabled.
e.) Customer Time-Out (seconds) : Specifies the amount of time after last agent message before the chat times out.
f.) Auto- Greeting : The way in which you want to greet the customer when the chat starts.

3.2) Creating Invitations



4.) Goto Customize -> Live Agent -> Live Agent Configurations.


5.) Goto Customize -> Live Agent -> Deployments
     Fill in necessary fields as below:

6.) Create a HTML Page and paste the button code and deployment code in the body.

<html>
<body>
<a id="liveagent_button_online_573o0000000L6Il" href="javascript://Chat" style="display: none;" onclick="liveagent.startChat('573o0000000L6Il')">Online Chat Content</a><div id="liveagent_button_offline_573o0000000L6Il" style="display: none;">Offline Chat Content</div><script type="text/javascript">
if (!window._laq) { window._laq = []; }
window._laq.push(function(){liveagent.showWhenOnline('573o0000000L6Il', document.getElementById('liveagent_button_online_573o0000000L6Il'));
liveagent.showWhenOffline('573o0000000L6Il', document.getElementById('liveagent_button_offline_573o0000000L6Il'));
});</script>

<script type='text/javascript' src='https://c.la3-c1-was.salesforceliveagent.com/content/g/js/39.0/deployment.js'></script>
<script type='text/javascript'>
liveagent.init('https://d.la3-c1-was.salesforceliveagent.com/chat', '572o0000000L4dF', '00Do0000000JPFp');
</script>
</body>
</html>

Note: In your code, the code highlighted will be in comment, so you can uncomment it before saving it.

7.) Goto Console and make yourself Online in Live Agent on the bottom right of the screen.
8.) Open the HTML page in browser and click on the Link on the page and Live Chat begins.

Next Topic : Live Agent Customizations