Skip to main content

Embedded chatbot events

List of supported events

Event nameFires when
oncehub.chatbot.loadedChatbot widget is first loaded, on page load.
oncehub.chatbot.openedVisitor clicks anywhere to interact with the chatbot.
oncehub.chatbot.startedVisitor starts interacting with the chatbot.
oncehub.chatbot.closedVisitor closes the chatbot widget.
oncehub.chatbot.button_clickedVisitor submits an answer in the chatbot (by clicking send or pressing enter).

Events payloads

oncehub.chatbot.loaded

Payload example:

{
"type": "oncehub.chatbot.loaded",
"payload": {
"bot_id": "BOT-1234",
"bot_name": "example bot"
}
}

oncehub.chatbot.opened

Payload example:

{
"type": "oncehub.chatbot.opened",
"payload": {
"bot_id": "BOT-1234",
"bot_name": "example bot"
}
}

oncehub.chatbot.started

Payload example:

{
"type": "oncehub.chatbot.started",
"payload": {
"bot_id": "BOT-1234",
"bot_name": "example bot"
}
}

oncehub.chatbot.closed

Payload example:

{
"type": "oncehub.chatbot.closed",
"payload": {
"bot_id": "BOT-1234",
"bot_name": "example bot"
}
}

oncehub.chatbot.button_clicked

Payload example:

{
"type": "oncehub.chatbot.button_clicked",
"payload": {
"bot_id": "BOT-1234",
"bot_name": "example bot",
"button_text": "confirm",
"interaction_label": "single_choice",
"booking_calendar_name": "Sales Team Calendar",
"question_text": "How many people are in your organization?",
"answer": "100-500"
}
}
note

This event triggers whenever a visitor submits an answer in the chatbot (e.g., selecting an option, typing a response, or confirming), but does not trigger for AI-generated responses or live chat sessions with human agents.