- Track how users interact with the sidebar.
- Log events for analytics or monitoring.
- Trigger workflows in your own app when specific Adopt events occur.
How to Use
We introduced an event subscription system that allows external applications to subscribe to AdoptAI-specific events emitted on the globalwindow object.This enables you to monitor and handle sidebar interactions (like message loads, tool executions, or user actions) in real time. Paste this code block after the SDK has been booted in your application.
Explanation
The Event Handler
- eventName — a string representing the event type (e.g.
adopt_copilot:message_loaded). - eventData — an object containing the event payload and contextual details.
Subscribing to Events
You can store or forward these events (for example, to analytics tools like Segment or Datadog), or trigger custom actions inside your own app. To clean up, call the function returned by the promise:
Available Events
All event names follow theadopt_copilot:<event> convention.
| Event Name | Description |
|---|---|
adopt_copilot:newConversation_click | Triggered when a user starts a new conversation in the sidebar. |
adopt_copilot:minimize_click | Fired when the sidebar is minimized. |
adopt_copilot:expand_click | Fired when the sidebar is expanded. |
adopt_copilot:history_open | Triggered when a user opens conversation history. |
adopt_copilot:history_close | Triggered when a user closes conversation history. |
adopt_copilot:action_initiated | Fired when a copilot action is initiated. |
adopt_copilot:action_executed | Fired when a copilot action completes successfully. |
adopt_copilot:action_failed | Fired when a copilot action fails. |
adopt_copilot:stop_execution | Triggered when a user manually stops a running action. |