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.

Disclaimer: The following section of this article is provided for instructional purposes only. Zendesk does not support or guarantee the code. Post any issues you have in the comments section or try searching for a solution online.
Important: This workaround is intended to be used by Zendesk Chat Phase 4 customers and Support customers who have the integrated Web Widget experience.
<!--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.

Powered by Zendesk