HelpCrunch Chat GTM Event Listener
Track HelpCrunch chat interactions in GTM. Monitor widget open/close, messages sent/received, email capture, and knowledge base usage with chatAction and chatMessage.
helpcrunchchatgtmga4supportsaascustomer-success
Event fired
helpcrunch_chat_actionKey variable
chatActionHelpCrunch Chat
Overview
HelpCrunch is an all-in-one customer communication platform with live chat, automated messages, email marketing, and a help center. This listener hooks into HelpCrunch's JavaScript SDK to track widget interactions.
Event fired: helpcrunch_chat_action
Variables: chatAction, chatMessage
Common Use Cases
- Track support chat engagement
- Measure proactive message click-through rates
- Build audiences from users who engaged with help center
- Fire lead events on email capture
Tracked Events
| chatAction | Description |
|---|---|
widget opened | Chat panel opens |
widget closed | Chat panel closes |
message sent | Visitor message |
message received | Agent/bot reply |
email captured | Email submitted |
auto-message shown | Automated message displayed |
auto-message clicked | CTA in auto-message clicked |
form submitted | Lead form completed |
Installation
html
<!-- GTM Custom HTML Tag: HelpCrunch Listener -->
<script>
(function() {
function hcPush(action, extra) {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push(Object.assign({
'event': 'helpcrunch_chat_action',
'chatAction': action
}, extra || {}));
}
var initHC = function() {
if (typeof window.HelpCrunch === 'undefined') return;
HelpCrunch('onWidgetOpen', function() { hcPush('widget opened'); });
HelpCrunch('onWidgetClose', function() { hcPush('widget closed'); });
HelpCrunch('onMessageSent', function(msg) { hcPush('message sent', { chatMessage: msg }); });
HelpCrunch('onMessageReceived', function(msg) { hcPush('message received', { chatMessage: msg }); });
HelpCrunch('onAutoMessageSent', function() { hcPush('auto-message shown'); });
HelpCrunch('onChatHidden', function() { hcPush('widget closed'); });
};
window.addEventListener('load', initHC);
})();
</script>Data Layer Output
json
{
"event": "helpcrunch_chat_action",
"chatAction": "message sent",
"chatMessage": "Hello, I need help with my order"
}Trigger Configuration
Trigger Type: Custom Event
Event Name: helpcrunch_chat_action
Variables to Capture
| Variable Name | DL Key | Example |
|---|---|---|
| DLV – HC Chat Action | chatAction | "message sent" |