Attributes in the Script Tag

Descriptions of required and optional script tag attributes.

cdnname: Customized CDN subdomain for your company. If you have not yet been assigned a customized name, use www.

group: Your assigned Group ID number provided by Glance.

Site: Two site options:

  1. staging – testing
  2. production – live

This allows Glance to push newer versions of the script tag to your staging site for testing before deploying to production.

Required Attributes

data-groupid: Same as group in the src attribute.

data-site: Same as site in the src attribute.

Optional Attributes

data-ui: See Default vs. Custom UI.

data-termsurl: A URL pointed to your terms and conditions page for the Cobrowse service. This is only required if you are using Cobrowse’s built-in terms and conditions window. Alternatively, this URL can be specified in the button customization tool. (See Style the Glance Cobrowse Button.)

data-inputevents: Maps input events to Glance Cobrowse actions. The data-inputevents format is:

{ “[modifier]-[keycode]” : “[Glance action]”, …}

For example:

data-inputevents='{"ctrl-13" : "startSession", "ctrl-9" : "toggleButton"}'

This above example indicates that pressing Ctrl+Enter should start a session and Ctrl+Tab should toggle the visibility of the Cobrowse button. Allowed modifier keys are Shift, Ctrl, and Alt. The key code may be any standard JavaScript key code. See Create and add a link or button to your web page for a list of Valid Glance Cobrowse Actions.

NOTE: Please use single and double quotes exactly as shown in the above example. The outer quotes around the attribute value should be single quotes, and the quotes within the attribute value must be double quotes.

Customers should still provide a link or button in addition to the key combinations to allow for starting sessions on mobile devices.

data-cookiedomain: The domain to use for the Cobrowse session cookie. This setting is typically required only for staging sites hosted on a public suffix domain such as azurewebsites.net or herokuapp.com. Specify the full host name as the cookie domain. For example, if your staging site is atabcco.azurewebsites.com, specify data-cookiedomain=”abcco.azurewebsites.com”`

data-cookietype: The type of cookie to use for the Cobrowse session. Possible values include the following:

  • normal (default): A non-secure cookie on your website domain. Use this value if visitors need to be able to navigate to insecure pages during a Cobrowse session.
  • secure: A secure cookie on your website domain. You may use this value if visitors will only need to be able to navigate to secure pages during a Cobrowse session.
  • ls: Local storage on your website domain. You may use this value if you would like to avoid adding a cookie to your domain, and if your visitors only navigate to pages on the same local domain.
  • dual: Both local storage and a cookie are used. Use this value if you have existing code which may delete cookies on your website domain, including the Cobrowse session cookie.

data-custver: Custom CSS cache buster version parameter. The Cobrowse button custom CSS file has a one week cache time. If a change is made to the custom CSS, specify any value in data-custver as a cache buster to force an immediate download of the updated CSS to all visitors.

For example:

<a href="javascript:;" glance_button="startSession">Cobrowse</a>

causes the anchor text Cobrowse to start a session and show the Glance Cobrowse UI when clicked, while <a href=”#” onclick=”javascript:return false;” glance_button=”showTerms”>Cobrowse</a> causes the anchor text Cobrowse to show the Terms and Conditions modal.

NOTE: When Cobrowse is integrated with a chat, it may not be necessary for the visitor to take any action to initiate a session.

By continuing to use the site, you agree to the use of cookies. Learn More