Conversation starter
Conversations started from the welcome screen, the Button app, or the Shopping Agent Chat, Shopping Agent Prompts and Help Me Choose widgets open with a conversation_starter chat event instead of a text message. The event tells the flow where the conversation was started and what the customer chose, so the flow can branch on fixed values instead of on the wording of a message. The Track Order widgets are not affected and still send their own track_order event.
The customer sees no difference: the text still appears as their message, including after a page reload and in other tabs. Messages after the opening turn are sent as normal message events.
{
"from": "customer",
"type": "chat_event",
"payload": {
"name": "conversation_starter",
"source": "welcome_screen",
"action": "track_order",
"text": "Where is my order A-2847?",
"data": { "orderNumber": "A-2847", "email": "[email protected]" }
}
}source- where the conversation was started. One of the fixed values in the table below.action- what the customer chose to do. One of the fixed values in the table below.text- the text shown as the customer's message, such as the question they tapped or the message they typed. Card numbers are masked whenmaskCreditCardNumbersis enabled.data- extra details, such as an order number. Always an object, which is empty when there is nothing to add. All values are strings.
source | action | data | When |
|---|---|---|---|
welcome_screen | track_order | orderNumber, name and email, each when the form shows that field | The customer submits the Where is my order? form. |
welcome_screen | track_order | Empty | The customer taps the one-tap Track your orders card. |
welcome_screen | product_enquiry | title, and productId if available | The customer taps the ask button on the current product card. |
welcome_screen | product_enquiry | name, and url and price if set | The customer taps a featured product, when openProductPage is not enabled. |
welcome_screen | question | Empty | The customer taps a popular question. |
welcome_screen | free_text | Empty | The customer types a message into the welcome screen input. |
shopping_agent_chat | question | productName, if set | The customer selects a suggested prompt in the Shopping Agent Chat widget. |
shopping_agent_chat | free_text | productName, if set | The customer types a question into the Shopping Agent Chat widget. |
shopping_agent_prompts | question | productName, if set | The customer selects a suggested question in the Shopping Agent Prompts widget. |
shopping_agent_prompts | free_text | productName, if set | The customer types a question into the Shopping Agent Prompts widget. |
button | question | productName, if set | The customer clicks a button in the Button app. |
help_me_choose | product_enquiry | productName, if set | The customer clicks the Help Me Choose tab or floating button. |
In your flow, check whether payload.name is conversation_starter, then branch on action, and on source where needed. Don't match on the wording of text: it is configurable and translated, so it can change.
If the opening turn isn't a conversation_starter event, treat it as a normal message. Its text is the same text the customer sees. Conversations still open with a normal message event when the opening message is sent by:
- a proactive button.
- your own call to
window.dgchat.methods.sendMessage. - a Headless SDK Component that opens the Genius Chat Widget, when the component and the chat widget are on different versions and one of them was released before conversation starters were added.
Updated about 10 hours ago
