Presence Visitor Side
The Glance Presence scripts provide functionality for:
- Tracking the presence of visitors on a website, including visitor identity, browser and platform information, as well as custom data.
- Signalling website visitors to take actions such as starting a Cobrowse session.
Glance Presence includes both:
- Visitor side functionality to send visitor data to the Presence service and listen for agent commands.
- Agent side functionality for looking up visitor information and signaling visitors.
Adding Visitor Presence to Your Website
There are two ways to include Visitor Presence functionality in your website. You can get default Presence behavior by adding some parameters to your Cobrowse script tag, or you can load and use the Presence API for more control.
Default Presence Behavior
The simplest way to add Presence to a website is to add a
data-presence='on' attribute to the Cobrowse script tag. With this approach:
Default Presence information is sent to the Presence service when the page first loads and again if it regains focus.
The visitor listens for functions invoked via
NOTE: The GLANCE.Presence.Visitor API will be available on the page, but you will not need to use it to get the default behavior described here.
Overriding Default Parameters
Some parameters, such as the visitor ID, can be controlled by adding additional attributes to the script tag, for example:
<script id="glance-cobrowse" data-visitorid="49275062" ... >
The parameters that can be added to the script tag are documented in the GLANCE.Presence.Visitor constructor function.
Custom Presence Data
Custom data can be included in the Presence data that is stored on the Glance Presence server. Examples of custom data might include a page name, user's shopping cart value, or the user's most recent transaction.
Custom data can be added to the Cobrowse script tag as attributes prefixed with "
data-user-", for example:
<script id="glance-cobrowse" data-presence="on" data-user-lasttrans="transfer" ...>