Events and Sessions

The widget can capture visitor context, keep active conversations available across tabs, and send product events that help support agents understand what happened before a message.

Page Events

For single-page apps, send page events when routing changes.

js
RogerIQ("event", { type: "page-viewed", url: window.location.href, title: document.title, source: "app-router"});

Custom Tracking

js
RogerIQ("track", "Checkout failed", { orderId: "ord_123", step: "payment"});

Session Data

Session data is string key-value context available during the current visitor session.

js
RogerIQ("session-data", { plan: "pro", tenant: "acme", region: "us-east"});
js
RogerIQ("consent", { analytics: "granted", persist: true });RogerIQ("consent", { analytics: "denied", persist: true });RogerIQ("consent", null);

Cross-Tab Session Handoff

RogerIQ stores active conversation session data in local storage and broadcasts updates across tabs. That lets a returning visitor continue the same active conversation from another tab.

Useful Events

EventPayload
readyWidget loaded.
open, closeLauncher visibility changed.
route-changedWidget route changed.
chat-started, chat-endedChat lifecycle changed.
message-receivedNew agent, AI, or system message received.
csat-submittedVisitor submitted a satisfaction score.
identity-updatedContact identity was accepted or rejected.
connection-statusRealtime connection changed.
Ask a question... ⌘I