Analytics Events
1. Feature Overview
The webchat widget now exposes analytics events that you can listen to in your parent application. These events provide real-time insights into user interactions within the webchat, helping you track user behavior, measure engagement, and integrate webchat activity with your existing analytics tools.
2. Getting Started
The webchat emits analytics events to the parent window that hosts the widget. You can directly subscribe to these events using the instance.onAnalyticsEvent()
method after the webchat has initialized.
Event Format
All analytics events follow a consistent JSON format, delivered within the data
property of the message
event:
{
"timestamp": "ISO_8601_DATETIME",
"event": "event_name",
"properties": {
"session_id": "UUID"
// Additional event-specific properties
}
}
timestamp: The exact time the event occurred in ISO 8601 format (e.g., 2025-03-26T16:18:44.212Z)
event: A string representing the type of analytics event (e.g., launcher_clicked
, chat_expanded
)
properties: An object containing additional context for the event, such as the session_id.
Subscribing to Events
After initializing the webchat, use the instance.onAnalyticsEvent() method to listen for events:
MoveoAI.init({
integrationId: "YOUR_INTEGRATION_ID",
// ... other options
})
.then((instance) => {
// Subscribe to analytics events
instance.onAnalyticsEvent((eventData) => {
// Access specific event details
const { event, properties, timestamp } = eventData;
// Implement your logic depending on the event
// ...
});
})
.catch((error) => console.error("Webchat initialization error:", error));
3. Available Analytics Events
Event Name | Description |
---|---|
launcher_clicked | User clicks the webchat launcher icon. |
chat_expanded | Chat window opens or expands. |
minimize_icon_clicked | User clicks the minimize icon in the chat header. |
close_icon_clicked | User clicks the close (X) icon in the chat header. |
close_opening_message_click | User closes the initial opening message/teaser. |
session_start | A new webchat session begins. |
session_end | A webchat session concludes (e.g., chat ended, inactivity timeout). |
message_click | User clicks on any message bubble in the chat transcript. |
terms_and_conditions_clicked | User clicks the "Terms and Conditions" checkbox (if present). |
terms_and_conditions_link_clicked | User clicks the "Terms and Conditions" link itself (if present). |
welcome_form_submitted | User successfully submits a welcome form (e.g., pre-chat survey). |
rating_clicked | User clicks a rating option (e.g., thumbs up/down, star rating). |
rating_submitted | User submits their chat rating. |
popover_review_clicked | User clicks a review popover (e.g., "Was this helpful?"). |
popover_inactivity_end_chat_clicked | User clicks "End Chat" on an inactivity warning popover. |
popover_inactivity_continue_clicked | User clicks "Continue" on an inactivity warning popover. |
popover_end_chat_clicked | User clicks "End Chat" on a general end chat confirmation popover. |
popover_end_chat_continue_clicked | User clicks "Continue" on a general end chat confirmation popover. |
popover_expired_new_clicked | User clicks "Start New Chat" on an expired session popover. |
popover_expired_end_clicked | User clicks "End Chat" on an expired session popover. |
resolved_popover_continue_clicked | User clicks "Continue" on a resolved session popover. |
resolved_popover_end_chat_clicked | User clicks "End Chat" on a resolved session popover. |
popover_review_skip_and_close_clicked | User clicks "Skip and Close" on a review popover. |
popover_feedback_close_clicked | User clicks "Close" on a feedback popover. |