Einstein monotile background

Article

Setting up agent actions

Nudge users to the next step of their journey and provide direction based on their needs.

my image Some great alternative text

Actions are provided to the user as options they can choose freely, to prevent autonomous decisions and keep the human in the loop. This article covers the different types of actions and how and when they can be triggered. Below is a screenshot from our website with several actions to give you an initial idea of what is possible.

Example action from the Unless website

For example, you can suggest a follow-up question, show an explainer video in a component, redirect to a relevant page, contact support, and more. Actions can be attached to an FAQ or a source, added to a component, or triggered based on custom criteria.

Adding an action

You can add an action via the Agent actions tab under the Data management section of your Unless dashboard. When creating any action, you first give it a name, define whether you want it to count as an escalation, and optionally add a pre-action message to display before the command gets executed.

Keep in mind: This name will be visible to the end user. So it's good to use a descriptive name, making sure they know what to expect when selecting this action.

Blank action details before you make any changes

Additionally, you can attach variables to actions. Think of it as something that needs to be known to complete an action. Whenever the value of a variable is unknown, the AI will ask the user for it. Below is an example where the user is asked to enter their email address.

Variable example: string (email)

Variables can be used to pass data to the command. For example, for actions related to an Order ID, the AI needs to know the order ID. If it isn't already known, the AI will first ask the user for input before initiating the action. In the example below, the user will be asked to select their company size: small or large.

Variable example: select (company size)

You can also add variables that depend on an existing value. Following the above example, if a user selects small company, we can ask for their company name, while for someone from a large company, we can choose to ask for their phone number instead.

Variable example: depends on existing value

Types of actions

Let’s go over the different agent actions you can set up. You can suggest a follow-up question, redirect to a URL, start a component, switch segments, execute custom JavaScript, start live chat, or call an API. Some of these are simpler to set up, while others require some technical knowledge. Each action type is explained below.

Suggest follow-up question

Follow-up questions can be a great way to keep the end-user engaged and nudge them further in their journey. It can help prevent the user from hitting a dead end after asking a single question. Plus, by suggesting frequently asked questions, you can get ahead of repetitive tickets.

For example, we noticed some website visitors ask our AI about components and how they relate to AI functionality. We already have an FAQ: What are components? We wanted to follow this up with the question “How is AI used in the components?” to inform these visitors further about the functionality of our software.

To configure this action, select the action type (command) from a dropdown and type the question you want suggested as a follow-up. Make sure to give your action a matching name.

Suggest follow-up question configuration

After you click Create action, you need to define when this follow-up question gets triggered. In the example below we’ve related it to the FAQ: What are components? Simply click the Add FAQ button and select one or more FAQs from the list. Make sure to update the action to save your changes.

Suggest follow-up question triggers

Redirect to URL

Similar to follow-up questions, redirecting to a URL can help guide the user further along their journey. For example, if someone asks about pricing, the AI can provide a comprehensive answer. But you can also take it a step further by suggesting to take them to the pricing page for more information.

You can set this action up by giving it a name, selecting the command from the dropdown, adding the URL you’d like to redirect to, and specifying whether you want it to open in a new tab or not.

Redirect to URL configuration

After you create/update the action, the next step is to define the triggers. In the example below, we’ve chosen to connect this action to an FAQ about pricing.

Redirect to URL triggers

Start component

The next action on the list is initiating a component. This can take many shapes. You could use a component with an explainer video, a book a meeting form, a multi-step component that helps with onboarding, and more.

In the example below, we see the action of starting a component. In this case, we selected a video component that introduces Unless components to users. (Very meta, yes.) All you have to do then is give your action a name and select the component you want from a dropdown.

Start component action example: Watch video

As a trigger, we opted for the FAQ: What are components? This means when a user asks about components, the AI will not only respond but also suggest a video explaining components in more detail.

Switch segment (topic)

Do you use topics in Unless to separate the information you have about different parts of your business (eg, different products or admin vs. regular users)? Then you can set up an action to switch between topics when necessary.

Switch segment action example: Product A

Execute custom JavaScript

That brings us to the more technical of the available action types: execute custom JavaScript. This allows you to run any JavaScript code when the AI action button is clicked. So the possibilities are endless, including:

  • Interacting with your application: If your web application exposes specific functions to the browser environment, this action can directly call those functions, facilitating seamless integration between Unless and your application's logic.
  • Leveraging the Unless JS API: Unless provides a JavaScript API that allows you to programmatically control various aspects of your Unless experience. This action enables you to harness the full power of this API, tailoring Unless to your precise requirements.
  • General JavaScript functionality: You can use this action to execute any valid JavaScript code. This could include manipulating the Document Object Model (DOM) of the current page, making asynchronous network requests, performing complex calculations, or any other JavaScript-based task. You can find the Unless JS API documentation here.

Start live chat

We offer a live chat integration for popular platforms such as Salesforce and Freshchat. Zendesk will soon be added as well. Once the integration process is completed with one of these platforms, the start live chat action becomes available within the system. This action allows for the seamless initiation of a live chat session with a customer, providing real-time support and assistance.

Furthermore, this action can be set as an escalation. This designation shows that the conversation was escalated to a live agent, typically due to the complexity of the issue or the need for personalized attention.

Additionally, AI variables can be leveraged within the live chat integration. These variables enable the collection of relevant information from the end-user before the conversation is transferred to a live agent. This pre-chat data collection can help the agent gain valuable context and insight, leading to a more efficient and effective interaction.

This can help you optimize your customer support efforts. You get the efficiency win of having an AI answer many customer questions while keeping agents in the loop, ready to step in when necessary.

API call

When the AI action button is clicked, an API endpoint on your backend can be called. This endpoint receives the configured headers and input fields, and sends back a JSON response. The AI can use this JSON response directly, or you can apply a JavaScript-based transformer to manipulate the data before giving it to the AI.

Some examples include requesting:

  • the user's order ID to retrieve the latest order status from your system,
  • the user's account ID to display their current balance and recent transactions,
  • the user's email to send them a personalized offer or discount code,
  • an invoice ID to check its status, or fetching a list of open invoices for the current user.

Here, as an example, let’s focus on the Contact support action. This is included in your account by default, but needs to be configured. It calls an API endpoint on the Unless API. Below is a screenshot of how this action looks when you first view it. You likely don’t have to change anything here (yet).

The email variable (to be collected from the end user) is important since that’s how you can reply to the support ticket, which will be created in your system.

API call action example: Contact support part 1

Once you scroll down, you’ll see the Body field with some code already. Below is a screenshot of our setup as an example. We’ve added our support email address for the conversation to be forwarded to. This will result in a ticket in your system. You can distinguish these tickets by the subject line you define in the same Body field. In our case: [AI]: Customer support request.

API call action example: Contact support part 2

At the bottom, there’s a section for success and error messages. These are prefilled but can be edited.

When and where to show an action

Based on triggers

Once you’ve configured your action, it’s time to define the triggers for when to show it. You can connect this action to one or more FAQs. You can set it to trigger following negative feedback, an unanswered question, or after every single response. Some of these options were already mentioned in the examples above.

Action trigger options

You can also execute an action immediately after a trigger is detected, without user interaction. For example, if you want to redirect to a different URL or show a component (video explainer, book a demo pop-up, etc.), you can choose not to wait for the user to click on the option.

Lastly, a more advanced option, you can set the action to only display under certain circumstances. This is done by entering JavaScript code that will be executed on the client before showing the action. The action will only show if the code returns true.

Connect to a source

We’ve already covered FAQs as a trigger for actions. However, you are not limited to FAQs alone and can also add Linked actions to other resource types. This means that anytime this source is used by the AI, it will also show the actions you linked to it.

Link actions to a source

The example above is a blog post from the Unless website titled: Introducing conversational UI components. If that blog post gets referenced by the AI, we want the “How is AI used in the components?” follow-up question to be shown, so we add it as a linked action. You can add one or more linked actions to a source, but we recommend no more than three, as more might be too much for the user.

What's next?

We recommend thinking through your most asked questions (listed on the insights page) and seeing what actions you would like the user to take. How can you engage and activate them to take the natural next step?

For example, for the question: Where can I find an overview of my statements? you could add an action that redirects them to the overview page with the name: Take me to my statements.

Or if there's a question that always requires human action and cannot be answered by the AI, you can attach the action of contacting support or starting live chat. There are many more possibilities and we'd be happy to brainstorm them with you!

my image Some great alternative text

Friendly support from real people

We’re here to help

We are known for our quick responses if you have an issue. Feel free to ask us anything. But you can also ask our conversational AI a question, of course!