The widget only draws the bubble and the conversation window. It does not provide track, pageview, or login.
Install
When analytics is already on the page, keep this single line and do not add a chat script:
<script defer src="https://static.pathclue.com/client.js" data-site="YOUR_SITE_KEY"></script>client.js loads widget.js when chat should appear: the first pageview response carries the widget address for the project's region (https://chat.askcub.com/widget.js in the Americas). On that same tag, data-chat="false" forces it off; to load without waiting for the response, add a widget.js tag as shown below. The widget derives the chat gateway from its own hostname: chat.askcub.com → ws.askcub.com, and the same for other regions.
Chat without analytics uses this line instead:
<script defer src="https://chat.askcub.com/widget.js" data-site="YOUR_SITE_KEY"></script>Initialize
The script looks for a tag with data-site, or an existing tapcub.siteKey, fetches the chat config, then draws the bubble. An empty site key does nothing. A second load on the same page is ignored, so a tag added later cannot change a bubble that is already drawn.
Pageviews
The widget does not send pageviews. client.js still does.
Events
The widget has no track. Keep business events on tapcub.track.
Identity
The widget has no login. Identify the visitor with tapcub.login on the analytics script. See JavaScript (client.js).
Limits
| Item | Requirement | What it means |
|---|---|---|
| Origin | Same host | widget.js and client.js share one origin |
| Tags | One | Do not add a chat tag when the analytics script is present |
| Site key | Required | With no data-site, the widget returns immediately |
Errors
If the bubble never appears, confirm the site key is on the analytics script, data-chat is not false, and the chat config is enabled. With Hide bubble on mobile on, phones show no bubble. The widget has no function to read online state, and it does not expose the connection as a callable API. Open the bubble and send a message as in Live chat quickstart, then confirm the desk received it.