Events and Sessions
Track page views, custom events, session data, consent, and cross-tab conversation continuity.
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.
jsRogerIQ("event", { type: "page-viewed", url: window.location.href, title: document.title, source: "app-router"});
Custom Tracking
jsRogerIQ("track", "Checkout failed", { orderId: "ord_123", step: "payment"});
Session Data
Session data is string key-value context available during the current visitor session.
jsRogerIQ("session-data", { plan: "pro", tenant: "acme", region: "us-east"});
Consent
jsRogerIQ("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
| Event | Payload |
|---|---|
ready | Widget loaded. |
open, close | Launcher visibility changed. |
route-changed | Widget route changed. |
chat-started, chat-ended | Chat lifecycle changed. |
message-received | New agent, AI, or system message received. |
csat-submitted | Visitor submitted a satisfaction score. |
identity-updated | Contact identity was accepted or rejected. |
connection-status | Realtime connection changed. |