Chatflows

Create a bot

Last updated: March 27, 2020

Create a chatflow with a bot to connect with your website visitors. The bot will appear as a chat widget on your website pages where a visitor can start a conversation. The bot can help qualify leads, book meetings, or create a support ticket by sending a series of questions and automated responses. Use the bot to gather initial information about the visitor before a member of your team takes over the conversation.

Please note: only users with Account access permissions can create and edit chatflows.

If you want to connect a visitor with a member of your live team as soon as they start a conversation via the chat widget, learn how to create a chatflow with live chat.

interact-with-bot-on-page

You can also create a bot for your Facebook Messenger account. Learn how to create a chatflow for Facebook Messenger.

Before you get started

Before you get started, make sure to connect a chat channel to the conversations inbox. The chat channel is where you can customize your team's availability and the appearance of the widget for your bots.

Once your chat channel is connected to the inbox, you can build a bot in HubSpot using one of three different bot templates, then customize your bot actions and routing logic to determine the flow of the conversation.

  • In your HubSpot account, navigate to Conversations > Chatflows.
  • In the upper right, click Create chatflow.
  • Select Website. Learn how to create a chatflow for Facebook Messenger.
  • In the left sidebar, in the Build a bot section, select a bot template: Qualify leads bot, Book meetings bot, or Support bot.

Please note: only Service Hub users with Admin access can create support bots.

  • In the upper right, click the pencil icon edit and select a language from the dropdown menu.
  • Click Next.
  • If you have more than one conversations inbox set up, in the dialog box, click the dropdown menu and select a shared inbox.

1. Build - create a bot welcome message

On the Build tab, customize the bot template and create a welcome message that will greet your visitors.

  • To edit the welcome message content, click the Welcome message step in the bot template.add-action-after-welcome-message
  • In the Welcome message panel that opens on the right, enter a message, then click Save.

customize-welcome-message-in-bot

  • To modify a bot message or action, click the action in the bot template. In the right panel:
    • Edit the bot action. The settings you can modify vary depending on which type of action you're editing. Learn more about setting up a bot action.
    • If you're a Professional or Enterprise user and want to customize the flow of the bot conversations, click the If/then branches tab. Learn how to use if/then branches in your bot actions.

Please note: Starter and free users cannot add if/then branches to their bot actions. 

add-a-bot-action

  • If you're a user with Account access permissions, you can route the bot conversation to a specific member of your team. To route the bot conversation to a member of your team, click the plus icon add, then select Send to team member in the right panel.

Please note: the user who you route to must have an assigned Sales Hub or Service Hub seat.

  • To reconnect any actions that became disconnected when editing your bot's flow, click the Alerts button in the top left. You can also search for any disconnected actions using the Go to action search bar in the upper right.review-disconnected-actions
  • When you're done editing the bot's actions, you'll see each action in the bot's path in a single view. You can view and make changes to your if/then branch logic, edit an individual action's settings, or search for a specific action using the Go to action search bar in the top right.
  • To see what the bot will look like on your website, in the top right, click Preview.
  • To continue, click Save at the bottom, then click the Target tab in the left sidebar.

2. Target - decide when the bot should appear

On the Target tab, you can decide when the bot will display on your website pages. You can display a bot when a visitor is on a specific page URL, or based on known information about your visitors. You can also combine the targeting options to create a tailored, personalized experience for visitors to your site. Learn more about the different targeting options and targeting rules you can use with your chatflows.

  • To show the bot when a visitor is on a specific website URL, in the Website URL section:
    • Click the first dropdown menu and select Website URL.
    • Click the second dropdown menu and select a targeting rule.
    • Enter your rule criteria in the text field.website-url-targeting
  • To show the bot when a visitor is on a website page whose URL includes specific query parameters:
    • Click the first dropdown menu and select Query parameter.
    • In the first text field, enter the query parameter name.
    • Click the dropdown and select a targeting rule.
    • In the second text field, enter the query parameter value.query-parameter-targeting
  • To add another rule, click Add rule.
  • To exclude the bot from certain pages (e.g. a privacy policy page), click Add exclusion rule.

You can also target your bot to specific contacts based on known information about them. To set criteria based on visitor information, in the Visitor information section:

  • Click the first dropdown menu and select a filter. You can use filters that specifically target known contacts or unknown visitors.
  • Click the second dropdown menu and select your criteria.
  • To add another rule, click Add rule.
  • To exclude the pop-up form on certain pages (e.g. a privacy policy page), click Add exclusion rule.
  • To create another filter group with additional targeting rules, click Add filter group.target-based-on-visitor-behavior
  • To continue, click Save at the bottom, then click the Display tab in the left sidebar.

3. Display - customize the bot's appearance

Customize the bot's display settings, including the chat heading, the chat widget behavior, and the chat widget triggers. To edit the bot's accent color and placement on the page, learn how to further customize the chat widget's appearance in your inbox settings.

  • In the Chat heading text field, enter a name for the bot. To change the image avatar, hover over the avatar and click Change photo.
  • In the Chat display behavior section, control the widget's behavior on desktop or mobile screens.
    • On the Desktop tab, select the radio button next to the preferred display behavior:
      • Pop open the welcome message as a prompt: display a preview of the welcome message above the chat widget.
      • Only show the chat launcher: only display the chat launcher so visitors have to click to open the chat window.
      • Open the chat widget: the chat widget will be open by default so visitors can immediately start a conversation with you.
    • On the Mobile tab, select the radio button next to the preferred display behavior:
      • Pop open the welcome message as a prompt: display a preview of the welcome message above the chat widget.
      • Only show the chat launcher: only display the chat launcher so visitors have to click to open the chat window.chat-display-behavior-desktop-and-mobile

Please note: to disable the chatflow on mobile devices, you can add an exclusion rule in your targeting settings to hide the chatflow when someone views your page on a mobile device.

  • You can also decide when to load the chat widget on the page. Select the checkbox next to the chat display trigger.
    • On exit intent: trigger the bot when a visitor's mouse moves toward the top of the browser window.
    • Time on page in seconds: trigger the bot when a specified amount of time (in seconds) passes while the visitor is on the page.
    • Percentage of the page scrolled: trigger the bot when the visitor has scrolled to a certain point on the page.
  • Click Save, then click the Options tab.

Please note: after you finish setting up your bot, you can automatically open the chat widget when a visitor loads a specific page URL. Append #hs-chat-open to the end of a page URL. You can then link these URLs in your emails, landing pages, and other marketing campaigns to send visitors directly to your chat widget.

4. Options

Customize additional options for your bot, including custom error messaging, the display language, and GDPR options.

General

  • To set a delay between each message that is sent to visitors, click the Typing delay between messages dropdown menu and select an option.
  • To customize the amount of time that should pass before the chat session is reset to the beginning, click the Session timeout dropdown menu and select an option. The timeout starts when the visitor stops responding. If the visitor sends another message after the timeout expires, the conversation resends the welcome message.

Please note: when a visitor completes every bot action, meaning they reach the last step in your bot's flow, the chat session will not reset after the selected session time expires.

  • To customize the response visitors see when a request fails, enter error messaging in the Generic error message field.

Language 

To change the bot's display language, click the Select a language dropdown menu and select a different language.

Availability

If your team is only available during set business hours, you can choose to always show the chatflow or only show the chatflow when your team is online. Click the Availability dropdown menu and select an option. Learn more about customizing your bot's availability preferences.

bot-updated-options-tab

Data privacy & consent

  • To enable the cookie consent text for the bot, click to toggle the Consent to collect chat cookies switch on. You cannot customize the consent to cookies text that appears in the banner.
  • To capture a visitors' consent to process their data, click to toggle the Consent to process data switch on.
  • Click the Consent type dropdown menu and select one of the following:
    • Require explicit consent: with this option enabled, visitors will need to click I agree before they can send a message.
    • Legitimate interest: visitors' consent is implied when they start to chat with you. The consent to process data text will still display, by they do not need to click I agree to start the chat.updated-chat-widget
  • In the Process consent text field, explain why you need to store and process your visitors' personal information.chatflows-live-chat-consent-to-process-data
  • Click Save.

Please note: while these features live in HubSpot, your legal team is the best resource to give you compliance advice for your specific situation.

When you are done editing the bot, in the upper right, click Preview to test's the bot's setup. When you're done editing, click to toggle the switch on to add it to your website pages. enable-chatflow

When you bot is live on your website pages, visitors can start a conversation with the bot. You can then view and respond to incoming messages in your conversations inbox, or analyze your bot's performance.

/chatflows/create-a-bot