Integrate Mavenoid with HubSpot's Chat Widget to connect users with live agents in HubSpot.
Contributor Access To Mavenoid: If you do not have contributor permissions, contact your Mavenoid representative.
Mavenoid Embed Script Access: The integration uses the External Script node in Mavenoid.
Use the External Script node to trigger the live chat to open when customers want to chat with an agent.
Copy the HubSpot's Chat Code:
Retrieve the HubSpot Chat Widget code. See HubSpot's guide Conversation SDK for details.
Configure HubSpot Opening Function:
After loading the Chat SDK, use widget.open() to open the chat widget.
Pass context to HubSpot:
To pass context from the assistant to HubSpot, follow these steps:
Initiate Conversation:
Use the conversationStarted event in HubSpot’s Chat Widget SDK to initiate the conversation and capture the conversationId. This ID enables adding messages to the thread.
Send Messages to HubSpot Thread:
Use the Call External API action with your HubSpot access token to send messages to the thread via the Send a message to a thread endpoint. Refer to the Integrate Mavenoid with HubSpot for details.
Configure Chat Handover Scripts: You’ll need two external scripts:
Script 1: Starts the conversation and hides the HubSpot Chat Widget.
Script 2: Shows the HubSpot Chat Widget after sending the message to the thread.
Close Mavenoid Assistant:
If using the Mavenoid Web Touchpoint, call mavenoid.push({ event: assistant-unmount })
to avoid widgets overlapping. The event widgetLoaded can be used to identify when the HubSpot's widget has been loaded.
Add HubSpot's Code to External Script:
See External Scripts for Chat Handovers for detailed setup instructions.