Kustomer Chat GTM Event Listener
Track Kustomer chat widget interactions in GTM. Monitor open, close, conversation events, and satisfaction scores with chat_Action variable.
kustomerchatcrmecommercegtmga4supportenterprise
Event fired
Kustomer_Chat_EventKey variable
chat_ActionKustomer
Overview
Kustomer is a CRM-native customer service platform, now part of Meta. It combines live chat, email, SMS, and social messaging with a unified customer timeline. This listener hooks into Kustomer's JavaScript API.
Event fired: Kustomer_Chat_Event
Variable: chat_Action
Tracked Events
| chat_Action | Description |
|---|---|
chat opened | Widget opens |
chat closed | Widget closes |
conversation started | Chat initiated |
message sent | Visitor sends message |
message received | Agent replies |
satisfaction submitted | CSAT rating sent |
conversation ended | Chat session closed |
proactive trigger | Proactive message shown |
Installation
html
<!-- GTM Custom HTML Tag: Kustomer Listener -->
<script>
(function() {
function kustPush(action, extra) {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push(Object.assign({
'event': 'Kustomer_Chat_Event',
'chat_Action': action
}, extra || {}));
}
var initKustomer = function() {
if (typeof window.Kustomer === 'undefined') return;
Kustomer.on('open', function() { kustPush('chat opened'); });
Kustomer.on('close', function() { kustPush('chat closed'); });
Kustomer.on('conversationCreate', function(data) {
kustPush('conversation started', { conversationId: data.conversationId });
});
Kustomer.on('messageSent', function() { kustPush('message sent'); });
Kustomer.on('messageReceived', function() { kustPush('message received'); });
Kustomer.on('satisfactionSent', function(data) {
kustPush('satisfaction submitted', { satisfactionScore: data.rating });
});
};
window.addEventListener('load', initKustomer);
})();
</script>Data Layer Output
json
{
"event": "Kustomer_Chat_Event",
"chat_Action": "conversation started",
"conversationId": "conv_abc123"
}Trigger Configuration
Trigger Type: Custom Event
Event Name: Kustomer_Chat_Event
GA4 Mapping
| GA4 Event | Condition | Parameters |
|---|---|---|
chat_widget_open | chat opened | chat_platform: "kustomer" |
chat_rating | satisfaction submitted | rating_value |