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 async src="https://YOUR_ORIGIN/w.js" data-site="YOUR_SITE_KEY"></script>w.js loads w-chat.js from the same directory when chat should appear. On that same tag, data-chat="true" forces the load and data-chat="false" forces it off. Omit the attribute and the first pageview response decides.
Chat without analytics uses this line instead:
<script defer src="https://YOUR_ORIGIN/w-chat.js" data-site="YOUR_SITE_KEY"></script>Initialize
The script looks for a tag with data-site, or an existing webcount.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. w.js still does.
Events
The widget has no track. Keep business events on webcount.track.
Identity
The widget has no login. Identify the visitor with webcount.login on the analytics script. See JavaScript (w.js).
Limits
| Item | Requirement | What it means |
|---|---|---|
| Origin | Same host | w-chat.js and w.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.