Visitor User Interface API
Cobrowse Visitor User Interface API
The Cobrowse Visitor User Interface API implements methods for displaying elements of the Cobrowse Visitor user interface, such as the Terms and Conditions dialog and the Cobrowse button. You also have the ability to customize the visitor-side user interface.
While most customers will use the "glance-button" attribute to connect web page elements with Glance Cobrowse functionality, for some implementations it is preferable to use the Visitor User Interface API directly.
The following methods are available on
|showButton(show)||showButton(show) displays the cobrowse button if show is true. If show is false, it hides the button.|
|toggleButton()||toggleButton() toggles the display of the cobrowse button.|
|showTerms(termsParams)||showTerms(termsParams) shows a terms and conditions dialog. The dialog, which is customizable via the cobrowse button customization tool, has an Accept and a Decline button. Clicking Accept will start a cobrowse session. termsParams is optional, and can contain any of the same properties as startParams.
See startSession in the GLANCE.Cobrowse.Visitor section.
|setStyle(groupid)||If the page is configured to cobrowse in multiple groups, call setStyle to control which group's cobrowse button customization should be used. If setStyle() is not called, the button customization is selected based on the group passed to showTerms or startSession|
|promptCrossDomain(crossDomainParams)||promptCrossDomain() prompts the user to continue a session on a new domain. Using promptCrossDomain()
promptCrossDomain() displays a confirmation message box like:
Would you like to continue the session on abc.com?
On Yes, GLANCE.Cobrowse.Visitor.crossDomain() is called to continue the session.
The colors, fonts, and text on the confirmation message box are customizable via the button customization tool.
promptCrossDomain() returns a promise which resolves when the process is complete. If the session has already been continued on other domains at the time promptCrossDomain() is called, the function returns a resolved promise.
If using a custom UI (
data-ui="custom" in the script tag) then the customer supplied user interface script can conditionally modify the user interface according to which group a session is running in. The custom user interface script can use the api GLANCE.Cobrowse.Visitor.sessionGroupId(), which returns the groupid for the currently running session, if any.
It is not possible to use a custom ui for one group and the default UI for other groups.