Branching by visitor data in chatbots

Edited

Overview

Use dynamic variables to branch your chatbot flows based on chat visitor attributes, and personalize chatbot message content for each chat visitor. Besides the default dynamic variables, you can also set up customized dynamic variables to pull from website data or contact data stored in Front to customize your visitor experience.

The benefits of using dynamic variables include:

  • Enabling faster resolutions and improving deflection

  • Maximizing the chance the chatbot can fully resolve inquiries without a human touch

  • Reducing the need for visitors to manually provide information you already know about them


When to use dynamic variables with chatbots

Example use cases where you can personalize your chatbot with dynamic variables:

  • Visitor website data

    • If the chatbot senses the visitor’s browser language is French, route them to French-speaking agents.

    • If the chatbot senses the visitor’s device type such as iOS or Android, direct visitors down the appropriate path.

    • If your chat visitor URL ends in “/pricing”, then direct visitors to a sales-oriented chatbot path. If the chat visitor URL ends in “/troubleshooting”, then direct visitors to a support-oriented chatbot path.

  • Contact data from Front

    • Use a “priority” field to route priority customers to your customer support team, and route non-priority customers to your knowledge base.

    • Use a “region” field to offer different chatbot branches when company processes vary by geographic location.

    • Use an “account type” field to offer different chatbot branches by audience (customers, vendors, partners).


How it works

Two dynamic variable features are available in the chatbot flow builder.

Branch by visitor data

Use the Branch by visitor data chatbot step to direct chat visitors down specific branches based on contact fields or chatbot website information.

Insert dynamic variable data into chatbot messages

Personalize your chatbot experience by adding dynamic variable data in your chatbot messages. Supported chatbot steps types: message, open-ended question, multiple choice question.


Option 1: Branch by visitor data

These instructions assume you’re familiar with using chatbots with Front Chat.

Step 1

Navigate to your chatbot flow builder and decide where you want to place your Branch by visitor data step. 

Step 2

Click the plus sign, then select Branch by visitor data.

Step 3

Fill in the following fields:

  • Branch if: Select an default dynamic variable or create a new one

  • Branches: Add branches based on the text or variables you want to match on

In this example, we’ll use the Page URL variable to branch the chatbot based on the website URL the visitor is chatting in from. We’ll create one branch if the visitor is on the pricing page, and another branch if the visitor is on the help page.

If you don’t see a variable in the dropdown list, it may not be supported in chatbots. See this FAQ to view the list of supported variables.

Step 4

Click Done to add the Branch by visitor data step to your chatbot flow. Continue adding steps to each path in your chatbot flow. Click Save when finished.

In this example:

  • If a visitor is on the pricing page, the chatbot will add the Sales tag and the visitor will be prompted to write a response

  • If a visitor is on the help page, the chatbot will add the Support tag and route the visitor to a chat agent

  • If the visitor is on any other page, the chatbot will ask the visitor for more information


Option 2: Insert a dynamic variable into a message

Step 1

Navigate to a message, open-ended question, or multiple choice question step in your chatbot flow.

Step 2

Click the plus sign in the text box. Select a default variable, or click New dynamic variable to create a new one.

In this example, we’ll select the default Name field to extract the contact’s name.

Step 3

The field will be added to the text box in your chatbot step. Continue editing the chatbot step as needed.

If you don’t see an option when creating your new dynamic variable, it may not be supported in chatbots. See this FAQ to view the list of supported variables.

Step 4

Click Done when you’re finished creating your chatbot step.


FAQ

Which variables are supported?

Contact fields

  • Branch by visitor data (option 1): All field types are supported for both default and custom contact fields. 

  • Insert a dynamic variable into a message (option 2): Only text and number field types are supported for both default and custom contact fields.

See the following articles to review default and custom contact fields:

Default and custom account fields are not currently supported.

Chat visitor website information

You can use the following information collected from your chatbot:

Field

Example use cases

Example values

Browser name

Provide browser-specific instructions

Chrome

Firefox

Browser language

Provide instructions in different languages

en-US

jp-JP


See list of all locales here.

Browser / mobile app version

Diagnose issues based on the customer’s app version

13.1.1

15.0.0

Current hour

Redirect customers after working hours to a different team in another time zone to ensure it gets handled


(Note: The default time zone for the current hour is America/Los Angeles. You can change this in the variable’s settings)

8

14

Date

Serve specific paths based on the day the chat visitor engages with the chatbot (online vs. offline paths)

While you can’t compare directly against the date, you can use transforms like Get hours and Get minutes to compare against numerical values.

IP address

Close chat for banned IP addresses

101.123.456.101

127.0.0.1

Is mobile device

Provide different instructions for mobile vs. non-mobile devices

True

False

OS

Provide OS-specific instructions

Windows

Macintosh

Linux

Page URL

Customize chatbot paths based on the web page your chat visitor initiated the conversation

https://front.com

https://yourcompanyhere.com/support

Much of the visitor information is read from the User-Agent header in the visitor’s browser. You can read more about User-Agent in the official Mozilla documentation.

Can I use a dynamic variable I created in another chatbot flow?

Dynamic variables are currently chatbot-specific. You cannot use the same dynamic variable across multiple different chatbots.

How do I set up branches using contact variables?

To use the Branch by visitor data step with contact variables, you'll first need to collect contact data from your chat visitor. There are two options:

  1. Set up the Verification secret setting in your Front Chat settings to automatically recognize logged in users.

  2. Set up a Collect contact details step before your Branch by visitor data step in your chatbot flow to manually collect contact data.


Pricing

This feature is available on the latest Growth plan or above.