Events
Events (/bots/:botId/events) let you define how the chatbot reacts to customer actions. For reacting to customers’ questions, use Answers. Each event has a conversation you build in the same editor as an answer.
What you can do here
Section titled “What you can do here”- Create the standard events and custom events.
- Build each event’s conversation with the same steps as an answer (messages, blocks, conditions, wait for input, API calls, AI answers).
- Copy the script that triggers a custom event from your website.
- Rename, delete, and in multi-market bots, enable auto translate.
Create an event:
- Click Create Event above the list and choose a type.
- For a Custom Event, type a name.
- Build the conversation. See Answers for the step types.
- Click Save changes.
Standard event types can be created once per bot. Custom events can be created any number of times.
Event types
Section titled “Event types”| Event | When it runs |
|---|---|
| Welcome Message | When a customer opens an empty webchat, or taps Get Started in Messenger. Greet them before they have typed anything. |
| Chat Timeout | Technical event for Daktela, Genesys and Salesforce chats: a handed-over chat expired in the operator tool because nobody wrote for a while. The admin shows 5 minutes; Amio support sets the actual period for each integration. |
| Chat Ended | When an operator closes a handed-over chat in Daktela, Freshchat, Genesys, Salesforce or SupportBox. |
| Web Chat Opened | When the customer opens the webchat again after a break. Amio support sets the length of the break; the event is off until they do. Amio Chat only. |
| Cart Updated | When the shopper’s cart changes in a conversation that already exists. Needs the cart sent from your site, see Cart Updated. Amio Chat only. |
| Custom Event | One you trigger from your web page with window.amioWebchat.triggerEvent(...), see Control the chat from your page. |
Cart Updated
Section titled “Cart Updated”Your site sends the cart to the chat with setCart and onAddToCart (see Shopping cart). When the cart changes, the Cart Updated event runs, so the bot can comment on it or suggest something.
It runs when the cart changes in a conversation that already exists. Changes less than 1.5 seconds apart count as one change, so one add gives one reply. It does not run:
- for the first cart the chat ever sees,
- when the cart is unchanged,
- for a visitor who has no conversation yet,
- while an operator has the chat after a handover. The cart is still saved, but the event is skipped.
If the cart changed while the chat was closed, the event runs when the shopper next opens the chat. A bot that also has Web Chat Opened set up may therefore answer twice on that open.
Each time a Cart Updated event reaches the bot, ${context.cartSource} says where the change came from: chat when the shopper used Add to cart in the chat, page for anything else (for example adding a product on your site). The event itself runs only for chat and page. The chat also sends the cart before the shopper’s next message without running the event; that sets cartSource to sync.
AI prompts can read ${context.cart} (the current cart), ${context.previousCart} (the cart before the change) and ${context.cartSource}. The cart stays in the context, so ${context.cart} works in the normal AI prompt too.
Example: suggest something only after an add from the chat.
- In the Cart Updated flow, add a Condition with a Context case: Context Path
cartSource, Equals, Condition Valuechat. - Connect that case to an AI step with a prompt like the one below.
- Leave the default case unconnected, so the flow ends there and the bot says nothing.
The shopper just added a product to their cart: ${context.cart}. Before the change it was: ${context.previousCart}.If the cart has a freeShippingThreshold and the subtotal is below it, tell them in one short sentence how muchmore they need (freeShippingThreshold - subtotal) to get free shipping. Otherwise confirm the add and suggest onematching product.Fields
Section titled “Fields”| Field | What it does |
|---|---|
| Name | Fixed for standard events. Custom events can be renamed from the menu. |
| Copy code (custom events) | Copies a one-line script, window.amioWebchat.triggerEvent('<event id>'), to call from your site. |
| Save changes | Saves the event. Disabled while a market follows the primary market. |
| Delete | Menu option, confirmed in the “Delete Event?” dialog. Cannot be undone. Only in the primary market. |
| Enable auto translate | Multi-market bots only. Changes to the source event are translated and applied to this market, and existing edits are lost. |
The Welcome Message and the other events use the same message editor as answers, including the Message transition at the end.