Skip to content

Create a bot

Last updated: August 22, 2024

Available with any of the following subscriptions, except where noted:

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 support tickets 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 Chatflows permissions on the CRM tab 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.

To watch an overview of this process, check out the video below:

See the full HubSpot Academy lesson: Setting up Conversations

Before you get started

Before you can create a bot, connect a chat channel to the conversations inbox or help desk. 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 to your external pages before you create a bot. The bot will not appear if the tracking code is not installed.

Create a bot 

Once your chat channel is connected to the inbox or help desk 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 add if/then branches to determine the flow of the conversation.

  • In your HubSpot account, navigate to Automations > 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 (Service Hub Professional or Enterprise only): 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. You need access to the knowledge base tool to use this bot template. 
      • 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 or help desk. 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.In the left sidebar, in the Build a bot section, select a bot template.

    Please note: accounts created after April 1st, 2024 do not have access to the Ticket bot and Knowledge base & support bot. Learn more about connecting chatflows to help desk.

  • Click Next.
  • On the Workspace page, choose an inbox or help desk and customizde language settings:
    • 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.

Build

On the Build tab, customize the bot template and create a welcome message that will greet your visitors. You can also add additional actions to customize the flow of the bot conversation. 

Create a welcome message

The welcome message is the first thing a visitor will see when they start a chat with you. 

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

customize-welcome-message-in-bot

Add bot actions

Whether you're creating a bot from scratch or using a template, you can use different bot actions to gather information about the visitor. You can ask questions, set a contact or company property value, share a knowledge base article, or book a meeting using bot actions. 

add-a-bot-action

  • In the right panel, select an action. Learn more about the different bot actions

select-a-bot-action

  • In the right panel, edit the action's details. The settings you can modify vary depending on the action. For example, if you're asking a custom question, you can enter the question and set quick replies that your visitor can select as responses to your message prompt. 
  • Click Save

add-a-bot-action

  • To edit an existing action's settings, click the action in the bot editor and make your edits in the right panel. 
  • If you're a Professional or Enterprise user, you can customize the flow of the bot conversation using if/then branches. If/then branches enable you to send a visitor to a specific bot action depending on their response, a contact property value, or your team's availability. 
select-action-to-add-branches

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

  • 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 add plus icon, then select Send to team member in the right panel. The conversation will be routed to an available team member, provided it's within the bot's operating hours

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.

Depending on your use case, after gathering some basic information about the visitor, you can then route the visitor to a member of your live team or to the conversations inbox or help desk for a team member to triage, or submit a ticket

Target

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.

Display

On the Display tab, 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, click to expand the Choose chat avatar section, then 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. Click Chat heading to expand the section.
    • 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.
        • Display quick replies below the welcome message: select this checkbox to display quick reply options directly below the welcome message, outside of the chat window. When this setting is turned off, visitors will need to open the chat widget to view and choose from the quick reply options.
      • 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. edit-chat-display-behavior-1

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. Click Triggers to expand the section, then 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.

Options

Customize additional options for your bot, including custom error messaging, the display language, and data privacy 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: 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

Collect feedback from chat visitors (Service Hub Professional or Enterprise only)

You can send a customer satisfaction survey from within the chat widget. Collecting feedback can help you improve your overall chat strategy, measure your team's effectiveness, and refine your individual team member's performance over chat. 

  • In the Collect feedback from chat visitors section, click the Connect existing survey dropdown menu and select a survey.

Please note: you can only connect an existing survey that has Chat selected as the delivery method.

collect-feedback-from-chat-visitors

  • To create a new survey to connect to the bot, click Create new survey. Make sure to select Chat as the delivery method.

When a chat conversation ends, the survey will appear in the chat widget. As survey responses are collected, they will appear in the survey details page and in the thread in the conversations inbox or help desk.

csat-survey-in-chat-widget

Review and add bot to your website pages

When you are done editing the bot, click Save. In the upper right, click Preview to test 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 your 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 help desk or analyze your bot's performance.

Was this article helpful?
This form is used for documentation feedback only. Learn how to get help with HubSpot.