Setting up Multiple Groups

All Cobrowse settings are specific to the group in which the session runs. These settings include:

  • Masked elements
  • Trusted domains for cross domain Cobrowse
  • Trusted domains for invoking Cobrowse from a “chat” window

Cobrowse supports running multiple sessions across different groups on the same website, enabling flexible call center models. Agent permissions can be configured to allow access only to sessions within designated groups.

Specify the Groups in the Script Tag

Customers can specify additional Group IDs in the script tag using the data-additionalgroupids attribute. For example:

data-additionalgroupids="59923,50920"

This allows different pages to be tagged with different sets of Group IDs as needed. However, a primary Group ID (data-groupid) must still be specified. This ID serves as the default group and is also required for non-Cobrowse features such as Presence.

Start a Session in a Particular Group

The GLANCE.Cobrowse.Visitor.startSession() API call accepts an optional groupid parameter, allowing you to specify the group in which the session should start. If this parameter is not provided, the session will default to the primary group defined in the script tag.

For example:

GLANCE.Cobrowse.Visitor.startSession({ groupid : 72 })

Starts a session in group 72.

Refer to the API section for more details.

An alternate Group ID can also be specified by the agent side when initiating a session via the Presence API.

Note: It is currently not possible to specify an alternate Group ID when starting a session using either:

  • A link with the data-glancebutton attribute.
  • Key combinations specified in the data-inputevents attribute in the script tag.

Security

Once a session is started with a specific Group ID, any agent with a Cobrowse subscription in that group will be able to view the session. For this reason, it is critical that website authors explicitly allow only the intended Group IDs to ensure proper access control.

Every time a session is initiated or resumed (whether via API call, window message, Presence, page navigation, cross-domain transition, or when the page regains focus) a validation check occurs. This check ensures the session’s Group ID either matches the data-groupid or is included in the data-additionalgroupids attribute defined in the script tag.

Refer to the Security section for more information.

Button Customization

Each group has its own button customization settings. When using the default UI, the Cobrowse scripts automatically load the appropriate button styles based on the group in which the session is running.

If you need to apply the button style from a different group, you can do so by calling:

GLANCE.Cobrowse.VisitorUI.setStyle()

Additional information is available here.

Presence with Multiple Groups

Presence always uses the group specified in the data-groupid attribute. Therefore, if an agent wants to join a session via Presence, they must be a member of both the group defined in data-groupid and the group in which the session is actually started.

Custom UI with Multiple Groups

When using a custom UI (data-ui="custom" in the script tag), the customer-supplied user interface script can dynamically adjust the UI based on the group in which the session is running.

The following API can be called to return the groupid of the currently running session, if one is active:

GLANCE.Cobrowse.Visitor.sessionGroupId()
Warning

It is not possible to use a custom UI for one group and the default UI for other groups.