Add Cobrowse to Your Website

For your convenience, Cobrowse generates a customized script tag for your account that you can copy and paste into your company website.

Find your Cobrowse Script Tag

For your convenience, Cobrowse generates a customized script tag for your account that you can copy and paste into your company website.

To find your Cobrowse script tag:

  1. Go to http://www.glance.net/ and click My Account.

  2. Log in to your account using your Glance Address and Password.

  3. Under Manage Your Account, click the Settings tab. The settings tab.

  4. In the bottom left corner of the Settings tab, click on Manage your Cobrowse settings. The script tag section will be displayed at the top of the page. The settings tab.

NOTE: Your Cobrowse script tag includes your company's unique Group ID. If you have multiple Glance groups, make sure when you are testing that the correct Group ID is in the tag, and that you are joining sessions as a Glance user in that group.

Script Tag Versions: Staging and Production

There are two versions of the script tag: one for your staging website, and one for your production website. Which profile of Cobrowse is used on your site is specified by the site attribute in the script tag. You should use Staging for your own internal staging environment and Production for your live site.

NOTE: Cobrowse will not work on a website accessed at localhost with the file://protocol. If you are trying out Cobrowse on a local website, please access it via a host name added to your local hosts file or equivalent.

Customize the Script Tag

Glance recommends that you start with the script tag provided in your account settings, then customize as needed using the parameters documented below.

The following is an example format of a customized Cobrowse script tag:

<script id="cobrowsescript" type="text/javascript"
  src="https://[cdnname].glancecdn.net/cobrowse/CobrowseJS.ashx?group=[groupid]&site=[production|staging]"
  data-groupid="[groupid]"
  data-site="[production|staging]"
  data-inputevents='{...}'
  data-termsurl="[terms and conditions url]"
  data-cookiedomain="[session cookie domain]"
  data-cookietype="[normal|ls|dual|secure]"
  charset="UTF-8">
</script>

NOTE: The script tag is required to be embedded via https to ensure the integrity of the JavaScript file.

Another example would be if your Group ID number is 0001, and you're deploying on your staging site with company cdnname "Abcco," your script tag would look like this:

<script id="cobrowsescript" type="text/javascript"
  src="https://abcco.glancecdn.net/cobrowse/CobrowseJS.ashx?group=0001&site=staging"
  data-groupid="0001"
  data-site="staging"
  charset="UTF-8">
</script>

Once a session is in progress, any tagged pages that the visitor navigates to will be included in the session. Pages without the script tag will not be included in a session and will appear to be "paused." This is shown by the screen darkening on the agent side, as if the visitor has navigated to another website or closed the browser tab.

Attributes in the Script Tag

View descriptions of each attribute in the script tag here.

Use a Meta Tag for Attributes

In some environments, it is not possible to add arbitrary attributes to a script tag. Cobrowse parameters can alternatively be specified in a meta tag.

For example:

<meta id='cobrowsescript' data-groupid='12345' data-site='staging' data-inputevents='{"ctrl-13":"startSession", "alt-190":"toggleButton", "shift-13":"showButton"}' ></meta>

If you are hosting the script on your own server, add an attribute data-scriptserver which tells Glance where to find the additional script and CSS resources that you host.

For example:

data-scriptserver='https://myscriptserver.net/scripts'

Manage Tags

The Glance Cobrowse script works with tag management systems such as Tealium and Ensighten and can be added to the page after the page load if desired. If adding the script tag dynamically, the following is the best cross-browser approach:

  1. Create the script element and set all attributes except the src attribute.
  2. Add the script tag to the document.
  3. Set the script tag src attribute.

Self-Hosting Scripts

Learn more about hosting scripts on your own server here.

Add the Script Tag

Once you are finished customizing your script tag, Cobrowse requires the script tag to be added to all pages within the website that will be viewable to the agent during a session. All, or some, pages of a website can be instrumented with the Cobrowse script tag. Since most websites are architected with a template used to generate some or all pages, the template is the appropriate location to add the Cobrowse script tag.

Additionally, if your IT Web Development team utilizes a tag management tool (Google Tag Manager, Tag Commander, SuperTag, etc.), you may use this to deploy the Cobrowse tag in the head section of the webpages. However, some tag managers (Google Tag Manager, Ensighten, etc.) may not allow you to add attributes to a javascript tag as in the previous examples.

To work around this, you can implement your tag into two separate sections: the meta attributes tag and the JavaScript loader tag. The meta attributes tag will include all the attributes needed (data-groupid, data-site, data-scriptserver) as well as all the optional attributes you might want to use (i.e.data-ui, data-inputelements, etc.). The JavaScript loader tag will provide the link to your group's Cobrowse script with the appropriate version.

An example looks like this:

<!--Meta Attribute Tag:-->
<meta id='glance-cobrowse' data-groupid="00001" data-site="staging" data-scriptserver="https://www.glancecdn.net/cobrowse">

<!--JavaScript Loader Tag:-->
<script id=id="cobrowsescript" type="text/javascript" src="https://www.glancecdn.net/cobrowse/CobrowseJS.ashx?group=00001&site=staging" charset="UTF-8"></script>

The script tag must be included on the page itself, as well as within certain iframes.

The id of the script tag must be “glance-cobrowse” or “cobrowsescript”.

iframes

Iframes must also include a script tag, unless one of the following conditions apply:

  • The hostname and protocol of the iframe match the parent. The hostname in the iframe URL matches the parent hostname. For example, the parent is at www.mycompany.com and the iframe is also at www.mycompany.com. If however, the parent is at www.mycompany.com and the iframe is at photos.mycompany.com, the iframe must have its own script tag. Also the iframe URL protocol, HTTP or HTTPS, must match the parent.

  • The iframe is dynamically built using JavaScript.

NOTE: The script tag is required to be embedded via HTTPS to ensure the integrity of the JavaScript file.

In the above listed cases, Glance is able to automatically include the iframe in the Cobrowse session.

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