Hubspot Live Chat Event Listener

Enhance your analytics by tracking how users interact with your Hubspot live chat widget and using this data to get profitable marketing and UX insights. With the help of Google Tag Manager, you can have this data available in your different analytics tools.

How to track Hubspot Live Chat Interactions with google tag manager

Measuring how users interact with your Hubspot live chat widget is easy and seamless using this Hubspot chat event listener and Google Tag Manager.

To track these interactions, start by creating a custom HTML tag in GTM, copy and paste this event listener code in that tag and trigger it on all pageview or DOM Ready (Recommended)

💡 Pro Tip: fire on DOM ready if you implemented the Crisp chat widget through GTM).

Your next step is to create two custom event triggers with event names;

[conversationBegan] –> when user starts a conversation

[conversationClosed] –> when a user ends a conversation

These data make it possible to analyze the impact of the live chat on your user experience, business funnels, conversions and other business KPIs.

You can connect your marketing tags to the appropriate triggers, and BOOM! you are now tracking this event and sending the data where you need it. (Always remember to DEBUG!!!)

 

🏆 Credit: Hubspot Created the code framework, which can be found here

<script type="text/javascript">
function onConversationsAPIReady() {
window.HubSpotConversations.on("conversationStarted", function() {
dataLayer.push({
event: "conversationBegan"
});
});

window.HubSpotConversations.on("conversationClosed", function() {
dataLayer.push({
event: "conversationClosed"
});
});

}
window.HubSpotConversations ? onConversationsAPIReady() : (window.hsConversationsOnReady = window.hsConversationsOnReady || [], window.hsConversationsOnReady.push(onConversationsAPIReady));
</script>

Video of how to use the listener

Related Event Listener

Olark Chat

With the Olark chat widget, you can track user interactions with the chat widget and fire your pixels/tag on these interactions & conversions.

Live Chat

Measure how users are interacting with your Livechat and fire your tags based on these actions using the Live Chat event listener.

Drift Chat

Event listener script that helps you track Drift chat interactions that happen on your website, easily and seamlessly.

download the google tag manager recipe for tracking Hubspot Live Chat Interactions

we make you smarter with data

made with ❤️

The DumbData Team
Before you leave, try out these free tools.
FREE GA4 AUDIT TOOL & UTM AUDIT TOOL