Prompt
How do I add chat to my website and connect it to HubSpot?
Latest observation
You can do this in a few different ways, depending on whether you want HubSpot’s built-in live chat/chatbot or a custom chat widget that sends data into HubSpot.
Option 1: Use HubSpot’s built-in chat
This is the easiest path if you want a website chat that syncs directly with HubSpot CRM.
Steps
-
Create / log into HubSpot
- Make sure you have access to the Conversations inbox and your website settings.
-
Go to the chat setup
- In HubSpot, navigate to:
- Settings → Inbox / Conversations → Chatflows
(the exact menu may vary by HubSpot version)
- Settings → Inbox / Conversations → Chatflows
- In HubSpot, navigate to:
-
Create a chatflow
- Choose either:
- Live chat
- Chatbot
- Hybrid (bot + handoff to human)
- Choose either:
-
Connect it to your website
- HubSpot gives you a tracking code / chat widget embed script
- Add it to your website’s
<head>or before</body>
-
Customize the widget
- Set greeting text, colors, position, availability, and routing rules.
-
Test
- Open your site in incognito/private mode and confirm the widget appears.
- Submit a test message and verify it shows up in HubSpot Conversations and the contact timeline.
Example embed snippet
HubSpot usually provides a script like this:
<script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/YOUR_PORTAL_ID.js"></script>
Replace YOUR_PORTAL_ID with your HubSpot portal ID.
Pros
- Fastest setup
- Automatically logs chats into HubSpot
- Can create tickets, route to teams, and associate with contacts
Option 2: Add a custom chat widget and send data to HubSpot
If you already have chat software or want a custom UI, you can still connect it to HubSpot using the API.
Typical flow
- User chats on your site
- Your backend stores the message
- You create/update the contact in HubSpot
- You log the conversation or messages into HubSpot
HubSpot APIs you may use
- CRM Contacts API to create/update contacts
- Engagements / Notes / Conversations tools to store chat history
- Forms API if you want to capture lead info
- Webhooks / workflows to trigger automations
Common implementation pattern
- Frontend chat widget sends messages to your backend
- Backend:
- checks if email exists
- creates/updates contact in HubSpot
- adds a note or custom object record
- optionally creates a ticket or deal
Option 3: Use a third-party chat tool integrated with HubSpot
If you want more advanced chat features, use:
- Intercom
- Drift
- Crisp
- Zendesk Chat
- Tidio
- LiveChat
Most of these have a native HubSpot integration:
- sync contacts
- push chat transcripts to CRM
- trigger workflows
This is a good choice if you want:
- better chatbot logic
- AI features
- support routing
- omnichannel inbox
Best choice depending on your goal
- Need the simplest HubSpot-connected website chat?
Use HubSpot Chatflows - Need a fully custom chat experience?
Build your own widget and connect via HubSpot API - Need powerful support/chat features quickly?
Use a third-party chat app with HubSpot integration
If you want to implement it yourself
A basic architecture looks like this:
Frontend
- chat button/widget
- message composer
- real-time updates via WebSocket or polling
Backend
- chat session API
- authentication / visitor tracking
- HubSpot integration service
- database for message history
HubSpot integration
- create/update contact by email
- associate conversation with contact
- add note or ticket
- trigger workflow if lead qualifies
Example: create/update a HubSpot contact from chat
You’d typically:
- Ask for email in chat
- Call HubSpot Contacts API
- Save the chat transcript
- Associate transcript with the contact
Important notes
- If you plan to collect personal data, include a privacy notice and cookie consent if required.
- HubSpot tracking script may rely on cookies and consent rules depending on your region.
- Make sure you only send data to HubSpot in compliance with your privacy policy.
If you want, I can give you one of these next:
- Exact steps to add HubSpot chat to WordPress
- A custom HTML/JavaScript chat widget example
- A Node.js backend example that sends chats to HubSpot
- How to connect an existing chat tool to HubSpot