To use the shortcode co-browse feature of Live Assist for Dynamics 365, add the shortcode tag to the pages of your site that you want visitors to co-browse. In the Live Assist Admin Portal click on the Get Started button (top right) and choose Shortcode:
Follow the instructions and, copy the tag into the <body>
of all the web pages you wish to co-browse:
The signature for invoking the shortcode feature of Live Assist for Dynamics 365 is as follows:
window.LAShortCodeService.requestShortCode(shortcodeCallback, successCallback, errorCallback);
Invoke this function call with your own UI action to trigger it and provide the following custom functions as the arguments:
See the following simple example:
There is also the option to cancel a shortcode co-browse session prior to the agent joining, as follows:.
window.LAShortCodeService.cancel()
- shortcodeCallback(shortcode)
- Called when a shortcode is allocated—this displays the shortcode to the visitor,
- shortcode—the short code
- successCallback()
- Called when the Agent submits the shortcode to begin the co-browse session.
- errorCallback(err)
- Called if there is an error when establishing the shortcode session.
- err—contains information about the failure.
Handling an Error Callback
The error callback can fire when the the requestShortcode is first called. The callback can also fire while the visitor is waiting for the Agent to enter the shortcode provided to start the co-browse session.
The errorCallback declared may return the following messages:
Error Callback on requestShortcode | Description |
---|---|
Timed out requesting short code | A connection cannot be established. |
Failed requesting short code | A non-2xx response is returned. The response contains additional information. |
Failed sending short code request | The method call returns an explicit error. The response contains additional information. |
Error Callback awaiting an agent | Description |
---|---|
requestShortCode timeout | The connection cannot be established. |
Short code timed out or was removed | The Agent does not join the co-browse session, or the short code is removed for some reason. (received after 3-minutes) |
Error polling for co-browse data | An explicit error is returned. The response contains additional information. |
Masking HTML elements
It's possible to mask page elements to prevent Agents from seeing what is shared during a co-browse. Please refer to HTML Mark Up for Masking for details.