Web chat v2 questions

Hi, I got some questions regarding the customization capabilities of the web chat widget.

  1. Is there any possibility for the web app to send a finished chat event or notification to Genesys? For example when the web client/browser is closed. I know the opposite way (Genesys -> web) is possible

2)It seems Genesys Engage web chat is the same, so same documentation applies. Regarding this:
https://docs.genesys.com/Documentation/GWC/Current/WidgetsAPI/WebChatEvents

messageAdded is only used to notify when there is new text in agent (genesys) side? or also in web side (customer)? If it's bidirectional, is it possible to filter only new texts introduced by the agent in Genesys side?

  1. Is it possible to recover chat session in web side? If there's some technical problem, or if the customer closes accidentaly the tab browser, i'd be a nice option to have

Thanks

#3 is not possible at this time. This would be a function of asynchronous chat, which we currently do not offer but is high on our priority list to deliver. You can use the ideas portal to comment on existing ideas or to request new functionality.

@Angelo_Cicchitto can you take a look at #1 and #2?

Hi,
#1 capturing web client / browser being closed, and reacting upon that might not always work 100% of the times. You could try to capture any browser event, and send a "Command" as the ones listed in API Reference, but not sure what you mean by "notification to Genesys": are you trying to terminate chat when customer closes tab or browser?
#2 It might be good to have more insight on what you're trying to accomplish (apparently it's about message filtering) as there may be several ways to get there.

Thanks for your initial feedback. Let me add more detail

#1 -> exactly that, we want to terminate chat from web side
#2 -> on web side we want to know when there is a new text introduced by the agent

Hello,

#1 -> detecting the closure of a tab/window/browser is really something which is on the browser & javascript side (and not up to the widgets themselves).

As Angelo mentioned above, it doesn't work 100% and doesn't capture all possible cases.

I have quickly tried with window.onunload (from https://developer.mozilla.org/fr/docs/Web/API/WindowEventHandlers/onunload ) and although I may have miscoded few things, it just captures a subset (I could only get the code triggered when a tab is closed but not the full window or if a link is clicked in the page - when closing the window, or the browser, or or if the user selects a new link in the url bar, nothing was triggered).
So you can try and check if that captures some of the events you'd like (or if there are other browser/javascript methods for this).

If you find what you need, you can call a WebChat or WebChatService command (using CXBus global variable) to end a chat.

CXBus.command('WebChat.endChat').done(function(e){
	// WebChat ended a chat successfully
}).fail(function(e){
	// WebChat has no active chat session
});

or

CXBus.command('WebChatService.endChat').done(function(e){
	// WebChatService ended a chat successfully
}).fail(function(e){
	// WebChatService failed to end chat
});

#2: WebChat messageAdded is triggered when a message is to be added to the transcript (in the UI). So this is triggered by customer messages, messages sent by a bot (Lex or Dialog Flow - integrated to PureCloud), messages sent from the Architect Chat flow (using Send Response block) and of course messages sent by agent(s).

The parameter passed to the function that you trigger (after subscribing to the WebChat.messageAdded event) is a structure with two properties: data and html.
Let's call that structure e (like in the doc). The type of participant sending the message is available in e.data.data.type & e.data.message.type.
For a customer, it will be "Client". For an agent, it will be "Agent"

#3 You can recover a session up to a certain point (this assuming the chat session was active when the "problem" occurred).

If you do a refresh on the page, the Widgets will automatically restart and reconnect the customer. Session info/details are stored in cookies.

If you switch to a different page which also has widgets enabled (the library), the Widgets will also automatically reconnect the customer [so the customer can go from one page to another, both with widgets enabled, and can continue the conversation and see his transcript]

If you close the browser tab, or if you close the browser window (but having the browser application still running on the computer - like on Mac, with Chrome, where you can close the windows but still having chrome application "running"), you have a couple of minutes to reconnect. If you reopen the page, and if cookies are still available, the Widgets can reconnect you.

If you close/terminate the browser application (and then reopen) or if you wait more than this couple of minutes to open the tab again, then the chat session is terminated.
The customer will have to generate a new session.

So in summary, if you wait too long (couple of minutes), or if you close the bowser completely (and cookies are then lost), you will have to generate a new chat session.

Regards,

Thanks, I will try what you suggest, looks promising

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.