HubSpot Chat: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
== Tracking In Tag Manager == | == Tracking In Tag Manager == | ||
https://community.hubspot.com/t5/Reporting-Analytics/HubSpot-Chat-amp-Google-Analytics-Event-Tracking/m-p/370205<br /> | |||
https:// | |||
<pre> | <pre> | ||
| Line 18: | Line 16: | ||
</script> | </script> | ||
</pre> | </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