Who can use this feature?
In this article, we will discuss integrating Concierge Fire with HubSpot Chat.
HubSpot chatbot builder is a software that allows you to create messenger bots that help you qualify leads, book meetings, provide answers to common customer support questions, etc.
With Concierge integrated with the HubSpot chat, you can ensure that your prospects will be routed to the correct rep from your team, saving time and letting your customers book a meeting right away.
Table of Contents
- Installation instructions
- Get your router POST URL in Chili Piper
- Setting up in HubSpot Chatflow
- Common Errors and Demo
Installation instructions
To get the integration working, we must rely on the custom code below, specifically designed for this purpose.
Important: The comments in the code below indicate where you need to replace for your instance and use case.
const request = require("request");
const linkTitle = "Book a Meeting!" // replace with the text you want to appear
exports.main = (event, callback) => {
let contact_email;
try {
contact_email = event.session.properties.CONTACT.email.value;
} catch (error) {
const responseJson = {
botMessage: "Oh no, I failed to find a valid email address :(",
responseExpected: false,
};
callback(responseJson);
return;
}
var options = {
uri: "https://vandenberghe.chilipiper.com/concierge-router/new-router/rest", // replace with your router's URL(POST)
method: "POST",
json: {
form: {
PersonEmail: contact_email,
},
},
};
request(options, function (_, _, body) {
const responseJson = {
botMessage: body.url
? `<a href="${body.url}" target="_blank">${linkTitle}</a>`
: `Failed to book a meeting...`,
responseExpected: false,
};
callback(responseJson);
});
Get your router POST URL in Chili Piper
To get your URL(POST), which you must replace in the code above, you need to
-
Ensure the "Button is clicked in-app" trigger is enabled in your concierge router's flow builder.
- Go to the "Embed" section within your router's flow builder, click "On a Website and/or Web App" and click the "Custom API" tab. Copy the URL (POST) and replace the value for "uri" in the code above.
Setting up in HubSpot Chatflow
The next step is to add a new node in HubSpot to your chatflow like this:
And then, we can insert the Chili code.
Important: make sure you update the value for "uri" in the code.
Once the code is updated with the correct details, it will look like this:
Common Errors and Demo
You may see an error while inserting the Chili code inside the chat flow, but you can ignore this. DO NOT try to edit or remove the '_,' because it will break the code and stop working.
And as soon we complete the steps successfully, below is a Demo of how it works: