At this time "onChatStarted" and "onChatEnded" only react to user actions and not to agent actions. So you can have a chat ongoing but you never received a started event, and viceversa, have the chat ended by never received the ended event.
This limits a lot the way we can "integrate" with the chat widget.
E.g: keep the widget hidden and let only agents to start/stop conversations (by show/hide the wisget when the agent start/stop them)
E.g.2: decide to always maximize the widget when a new message from the agent is sent (maybe depending on the message itself).
Louren van Garderen commented
I'd like more or less the same as Jacob. To be concise, I'd like to:
- Trigger events from backend (maybe with optional values, i.e. a command like track(key,value))
Jacob Beckstead commented
In my case, I need the agent to interact with the chat so that I can record a conversion, because not all chats are conversions. I need agents to make a decision that can lead to an action that can trigger an onCustomEvent() function or similar.