Chatflows

Create a bot

Last updated: October 13, 2020

Applies to:

All products and plans

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 can create a bot, 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. In addition, if you're adding the bot to a website that is not hosted with HubSpot, you need to add the tracking code your external pages before you create a bot. The bot will not appear if the tracking code is not installed.

Once your chat channel is connected to the inbox and the tracking code is installed on any external pages, you can build a bot from scratch or using one one of five different bot templates created by HubSpot, 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. If you want to add a chatflow to your Facebook Messenger account, learn how to create a chatflow for Facebook Messenger.
  • In the left sidebar, in the Build a bot section, select a bot template:
    • Concierge bot: use this template to direct visitors to the right team based on their reason for starting a chat. Depending on the visitor's response, they can search the knowledge base, connect with a member of your live team, or book a meeting with your team.
    • Qualify leads bot: use this template to gather information about the visitor and their reason for visiting your site.
    • Meetings bot: use this template to share a meeting link with a visitor so they can book time with you or your team.
    • Tickets bot: use this template to gather information about a visitor’s support inquiry, then create a ticket to track their issue in your conversations inbox. You must have access to edit tickets to use this bot.
    • Knowledge base & support bot (Service Hub Professional or Enterprise only): use this template to share knowledge base articles with visitors, then give them the option to reach out to your team or submit a ticket if they still need help. Before using this template, select users and teams to route conversations to if the inquiry cannot be resolved with an article.
    • Offline bot (Sales Hub or Service Hub Professional and Enterprise only): use this template to route visitors to your available team members so they can start a conversation right away. Or, if your team is unavailable, you can collect the visitors email so your team can follow up later. Before using this template, select the users and teams whose availability will determine the bot’s flow.
    • Start from scratch: create your own bot from scratch using different bot actions.
  • Click Next.
  • On the left, customize the inbox and language settings:
    • If you have multiple inboxes set up in your account, click the Inbox dropdown menu and select an inbox to connect the chatflow to.
    • To change the chatflow's language, click the Language dropdown menu.
    • If you're creating a Concierge bot or a Meetings bot, to choose which meeting link is shared with the visitor, click the Meetings link dropdown menu.
    • If you're creating a Knowledge base + live support bot or an Offline bot, to control which users receive incoming messages, click the Select inbox users dropdown menu.

select-inbox-for-chatflow

  • Click Create.

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.

  • By default, the company name that you set in your account's branding settings will display as the chat heading. To edit the chat heading, edit the name in the Chat heading field. 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.
      • Show the welcome message then pop open the chat when a trigger is met: display a preview of the welcome message and open the chat widget when a trigger is met or when the visitor clicks on the widget, whichever comes first.
    • 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.

Please note: for a faster page load, HubSpot recommends a delay of 5 seconds or more. Learn more about your site's page load time.

    • Percentage of the page scrolled: trigger the live chat widget 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.bot-updated-options-tab

Language

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

Availability

Decide when the chat widget should appear on your site depending on your team’s availability set in your channel settings. Click the Availability dropdown menu and select an option:

    • Only show when team members are available to chat: the chat widget will only appear during business hours or when at least one team member is available.
    • Show always: the chat widget will always appear on your site.

Please note: keep in mind that if you have multiple chatflows set up in your account, chatflow prioritization does not check team availability when deciding which chatflow to display.

Data privacy & consent

  • To enable the cookie consent text for the live chat widget, click to toggle the Consent to collect chat cookies switch on. You cannot customize the consent to cookies text that appears in the banner.
  • When you enable the cookie consent text, you can then select when the consent banner should appear.
    • To display the consent banner before a visitor starts a chat, select the Show consent banner before visitor starts a chat radio button.
    • To display the banner when the visitor starts to leave the page, select the Show consent banner to visitor on exit intent radio button.

consent-banner-with-display-options

  • 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, HubSpot's default text will appear. You can edit the text to explain why you need to store and process the visitor's personal information. If you customize the consent text but then want to return to the default text, click Reset to default text provided by HubSpot.consent-to-process-default-text

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

Marketing contacts

If you have access to marketing contacts in your account and you want contacts created from this chatflow to be set as marketing contacts, click to toggle the Marketing contacts switch on.

marketing-contacts-for-chatflows

When you are done editing the bot, click Save. 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.