We're looking to see if there's a way to end a messenger session without clearing chat history for the customer. Currently, we're looking at using MessagingService.clearConversation but noticed it clears all history upon the session ending (closing the site triggers an unload event, which sends the clearConversation command). When the customer navigates back to our site, all history is gone. We really envision this being handy when a customer accidentally closes our website and wants to return. This would also allow our customers to take advantage of the threading timeline as they come and go.
This all stems from the core issue that if a customer closes our website while connected to a chat, the agent receives no notification except an error on delivery when then try to send a message. This is not ideal as agents are not aware the customer has disconnected and sit back to wait for a response.
We opened a care ticket and were told there isn't an official command or solution. So I was hoping someone here may have some insight!
Hey Caleb. Agents can freely disconnect from the conversation without impacting the customer's view of the session. This would allow an agent to disconnect after some inactivity and still allow the customer to continue the same conversation later on.
Is there a reason this approach isn't working for you?
What is the flow you are looking for? If you don't want to clear, then don't use that command. It will stay active and only clear after 72 hours of activity. So, no unload event at all will give you that behaviour.
Hi Chad... Just to add some more details, here's the scenario: A customer connects to a messenger session on our website. They reach and agent and send a few messages. Without saying goodbye, they simply X out of our website. The messenger session is still connected for the agent and the agent is unaware the customer has left the website. The agent will now wait for a response for X time until they send a follow-up message and get the error on delivery message. Only then does the agent know the customer left the website.
In a perfect world the customer would use the trash can to end the chat or say thank you.. good bye. This doesn't always happen so we're looking for a work around to simply end the chat when they leave our website which is where the Messenger SDK command comes in. The issue with that command is that it clears the history along with killing the session. We just want to kill the session so that if a customer returns within 72hrs, the history remains.
So what you're looking for is not exactly possible today. The "clear conversation"/trash can on the Messenger side was somewhat intentionally designed this way, where it is more about clearing conversation history for the customer for privacy reasons (such as when using a shared device).
I think your best route here would be using the Conversation Disconnect settings in step 6d here. Upon agent disconnect the message history would still be available to the customer, but your configuration can determine whether the conversation can be continued or if the history must be lost and a new session started.
We do have two Ideas we're monitoring that should help here as well.