HubSpot Chat: Difference between revisions
Jump to navigation
Jump to search
Created blank page |
|||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
== Tracking In Tag Manager == | |||
https://community.hubspot.com/t5/Reporting-Analytics/HubSpot-Chat-amp-Google-Analytics-Event-Tracking/m-p/370205<br /> | |||
<pre> | |||
<script type="text/javascript"> | |||
window.addEventListener("load", function(){ | |||
window.HubSpotConversations.on('conversationStarted', function(payload){ | |||
// ga('send', 'event', 'Beacon', 'chat-started', 'Hubspot'); | |||
window.dataLayer.push({ | |||
'event': 'hubspot-chat-started', | |||
'hs-chat-id': payload.conversation.conversationId | |||
}); | |||
}); | |||
}); | |||
</script> | |||
</pre> | |||
*Note: may need to be put in DOM ready so it loads after the chat | |||
Latest revision as of 13:40, 31 August 2022
Tracking In Tag Manager
<script type="text/javascript">
window.addEventListener("load", function(){
window.HubSpotConversations.on('conversationStarted', function(payload){
// ga('send', 'event', 'Beacon', 'chat-started', 'Hubspot');
window.dataLayer.push({
'event': 'hubspot-chat-started',
'hs-chat-id': payload.conversation.conversationId
});
});
});
</script>
- Note: may need to be put in DOM ready so it loads after the chat