Create a Bot
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.
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 to 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 add if/then branches 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 (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. 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): if your team is only available during set business hours, use this template to route visitors to available team members during business hours, then collect the visitor's email when your team is offline. You can also edit the bot's setting so that the chat widget appears outside of business hours. Visitors can leave their email address so your team can follow up when they're back online. 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.
- Click Create.
1. Build - create a welcome message and add bot actions
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.
- - In the Welcome message panel that opens on the right, enter a message, then click Save.
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.
- - To add new questions or actions, click the add plus icon.
- In the right panel, select an action. Learn more about the different bot actions.
- 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.
- 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 an action.
- - In the right panel, 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.
- - 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.
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.
- - 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 for a team member to triage, or submit a ticket.
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.
- 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.
- - 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.
- To continue, click Save at the bottom, then click the Display tab.
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, 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.
- - 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.
- - On the Desktop tab, select the radio button next to the preferred display behavior:
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.
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
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.
- 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 chat
- 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.
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 ontacts switch on.
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.
- - 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.
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.
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 analyze your bot's performance.
Credit to HubSpot Knowledge Base