Trigger a chatflow bot using a JavaScript function
SOLVE
Hi,
I am trying to get a chatflow bot to trigger using a JavaScript function on our website. I've created a bot under Conversations -> Chatflows. Is this possible?
This is indeed possible, depending on your function itself, if you control the chat widget and how it loads.
In this case, you can trigger the chat widget to load after your function fires using:
window.HubSpotConversations.widget.load();
/* ... */
// Force the widget to load in an open state
window.HubSpotConversations.widget.load({ widgetOpen: true });
This is indeed possible, depending on your function itself, if you control the chat widget and how it loads.
In this case, you can trigger the chat widget to load after your function fires using:
window.HubSpotConversations.widget.load();
/* ... */
// Force the widget to load in an open state
window.HubSpotConversations.widget.load({ widgetOpen: true });