Question
My customers can still chat with us after all agents have gone offline. Why is this happening?
Answer
In Zendesk Chat, agents do not have the ability to end the chat on behalf of the visitor once the chat has started. The connection is still open until the visitor ends the chat, or the chat session ends. For more information, see the article: When do chats time out?
An agent can end the chat in the user interface but the visitor could still have the chat dialogue open and begin a chat conversation. The new reply might go answered which could cause confusion because there are no agents to take the chat.
Adding custom script
It is possible to write a custom script that ends a chat as soon as an account goes offline.
<!--Callback to end chat when account goes offline -->
<script type="text/javascript"> zE('webWidget:on', 'chat:status', function (status) { if (status === 'offline') { zE('webWidget', 'chat:end') } else { console.log('This chat session is now', status); } }); </script>
<!--Callback to end chat when account goes offline --> | |
<script type="text/javascript"> | |
zE('webWidget:on', 'chat:status', function (status) { | |
if (status === 'offline') { | |
zE('webWidget', 'chat:end') | |
} else { | |
console.log('This chat session is now', status); | |
} | |
}); | |
</script> |
For more information, consult the Chat API documentation.
7 comments
Sprout Social, Inc.
Under Performance Steps, it says "It is possible to write a custom script that ends a chat as soon as an account goes offline."
What/who exactly is "an account"? Would that be when the agent ends the chat?
0
DJ Buenavista Jr.
Thank you for reaching out to Zendesk Support.
In regards to your concern, the following "account" that was mentioned in the article is the Zendesk account. Meaning, once there are no agents available or if all agents have gone offline, then the chat will automatically be closed.
Thank you!
Kind regards,
0
Bex Heenan
Hi there,
Is there a way to have this timeout after a agent has closed the chat from our end, rather than when we're offline?
We wouldn't want to just cut chats off when we switch to Invisible. For example, if we were chatting to a customer and we then switched to out of hours, we wouldn't want the chat to be disconnected. However, once we end the chat, we don't want the customer to then be able to continue chatting if we're not there.
Thanks!
0
DJ Buenavista Jr.
Thank you for reaching back to Zendesk Support.
An agent cannot close the chat, not unless he/she manually disconnected from the chat. Also, when an agent switches to Invisible status, the ongoing chat would remain and it will not disconnect.
Once all of your agents switch to Invisible status and there are no available agents, then your customers will not be able to reach chat or get into the queue for a chat. Once you have operating hours enabled and set, your agents will not be able to go Online outside operating hours and your customers will not be able to get into a chat.
Thank you!
Kind regards,
0
Jason Walker-C
Really need this and/or this https://support.zendesk.com/hc/en-us/articles/4408835731994
0
Dave Banaszak
Is there a way to implement this at the chat department level as opposed to account level ie for when a customer is waiting in a chat department that is no longer staffed by an active agent?
0
Beto
Hello Dave, thank you for your question!
The script mentioned in the article itself would have to be an account-wide setting, but the recommendation provided by DJ regarding a schedule with operating hours can definitely be set depending on the Department.
You can create different operating hours based on the Department, by following the steps here: Creating a schedule with operating hours.
I hope this was helpful!
0