Real HubSpot Conversations widget (account 245031222). The ListenLayer adapter
(code hsc) subscribes to the official HubSpotConversations.on() API for
conversationStarted → chat start (with conversation id),
userSelectedThread → keeps the conversation id current (no event),
conversationClosed → chat end. Agent replies (cmr) are
inferred from the widget's show/clear-page-title-notification
postMessages (the browser-tab "(1) new message" flash) — the mechanism ported from the
proven v3 script (Redmine #75506; the old unreadConversationCountChanged
signal stayed 0 while the widget was open and never fired cmr). Widget
open/close come from the widget's open-change postMessage
(isOpen:true → open, isOpen:false → close), and a
(text-less) user-message-sent comes from the external-api-event/inputStaging
postMessage when the compose box clears on send.
Open the chat bubble in the bottom right and start a conversation to see
chs/cho/cms/cmr/che fire.
Note: HubSpot's .on() API has no reliable widget-open event
(widgetOpened never fires; userInteractedWithWidget only fires on
interaction), so open/close is sourced from the open-change postMessage instead.
It exposes no message text (neither sent nor received), so cms
is a text-less send count (from the inputStaging postMessage — .on()
has no message-sent event at all). It also exposes no email —
contactAssociated carries only a confirmation string. cec
still fires from it (the wire event is plt/cid only, so
"visitor submitted an email" needs no address), but no person is created:
identifying which address needs the server-side Conversations webhook.
cmr is reliable when the visitor is
not focused on the widget (show-page-title-notification is
1:1 with an agent message); while focused, HubSpot fires no per-message signal, so the
clear-based count is best-effort — a documented platform limitation, guaranteed
per-message counting needs the server-side Conversations webhook.