The bot needs access to certain user-specific information for successful end-to-end automation that is personalized and delivers the best customer experience to your users. What are my options?
- Gathering Metadata
- Sunshine Conversation Requirements
- Ultimate Requirements
- Update Zendesk Custom Fields
Gathering Metadata
In case we want to access some custom user information (that isn’t directly available to the bot in the frontend, such as the website), we recommend doing this via API integration as it makes it a lot simpler. This way, you can also reuse the integration for different channels (meaning, you don’t need to redo it for web, mobile SDK and social media channels).
This is also the approach Zendesk takes: most customer data is retrieved by API directly instead of first saving the information to SunCo and then retrieved by the bot.
However, some information is available to the bot in the frontend - such as the website, and therefore can be added to the user Metadata.
As an example: A user is logged in and requests a chat on their Booking page where they’re reviewing the details of their latest booking.
▶️ By looking at the page URL, I can see the booking reference is visible.
▶️ I can also see the page where the chat started from - along with locale information
▶️ Frontend also reveals whether the user is logged in to their account
As a general rule, it’s best to include information to SunCo metadata that is already available to us - like the URL of the page chat started on, whether the customer is logged in, or which channel they are using. The information available varies from client to client.
Sunshine Conversation Requirements
In order to retrieve this Metadata, the SunCo chat widget needs to be updated. Adjust the SunCo chat widget script to capture and include all relevant metadata information the bot should know when a customer requests chat.
Below you can find an example, however, please do refer to Sunshine Conversations for the most up-to-date information on this,
Smooch.updateUser({
email: 'example@email.com',
metadata: {
latestOrderNumber: 'order number',
loggedIn: 'true',
customerType: 'customer type'
}
})
More information for adjusting the widget snippet on Zendesk / SunCo gitHub and Smooch API reference
Ultimate Requirements
Now that you are retrieving this information, it needs to be saved to the session.
You do this with Ultimate actions to get and save metadata to the session and update it to Zendesk after the conversation with the customer ends
This can be done at bot-level by adding the Get User action to get and save the metadata information to the session. You would need to reference the Metadata Key with the names from the widget snippet (but you can save them as whatever you want):
The above action saves the user metadata information to the conversation session. This means, the bot doesn’t need to ask for this information from the user again but can update them to Zendesk through pass control (screenshot below). This way, your Support Agents won’t need to update these ticket fields manually.
When you want to update the metadata field after saving it to the session, you will need to use the Field ID from Zendesk - which you can find by going to Zendesk Admin Center > People > User Fields
A recommendation from our side is to use conditional blocks to check whether the above information exists in the session - and if not, use the bot to ask for this information from the user
Update Zendesk Custom Fields
Something to bear in mind is that SunCo doesn’t have an integration with Zendesk - this means Ultimate can’t access custom field information directly through metadata or other SunCo action.
Custom Fields, however, can be updated via pass control i.e. when the bot escalates to Zendesk Agent Workspace or a ticket is created.
The SunCo action Update User
can be used to update custom fields in Zendesk, both free text and drop-down fields.
Each Zendesk drop-down field value has an associated tag. This is what you would typically use in ZD Chat integrations to select drop-down items.
The difference with SunCo is that instead of updating the field, we can just set the tag directly. As long as it matches the tag associated with the field value, it also selects that option in the drop-down automatically.
Get Tag Values
-
In Zendesk, go to Settings > Ticket Fields and open the field you’re looking to update.
-
In the Field Values section, click the Show Tags option at the top right to see the corresponding tags for each drop-down value.
Add the SunCo action
For this, we’ll use Add Tags
to add the tag. All tags will be added to the list of existing tags. This is a free text field, so you can type the name of the tag you would like to be applied. Multiple tags can be added using the plus button.