Smartsupp Chat GTM Event Listener
Track Smartsupp live chat interactions in Google Tag Manager. Monitor chat open, messages sent/received, and agent status. Capture chatAction and visitorID.
smartsuppchatgtmga4supportecommerce
Event fired
SmartsuppChatEventKey variable
chatActionSmartsupp Chat
Overview
Smartsupp is a live chat solution popular in European markets, with video recording and chatbot features. This listener uses Smartsupp's JavaScript API to track widget interactions and push SmartsuppChatEvent events to the GTM dataLayer.
Event fired: SmartsuppChatEvent
Variables: chatAction, visitorID
Common Use Cases
- Track chat engagement on European eCommerce sites
- Measure chat initiation rates across product pages
- Build GA4 audiences from chat users
- Combine with Smartsupp's session recording data for UX analysis
Tracked Events
| chatAction Value | Description |
|---|---|
chat widget opened | Widget expanded |
chat widget closed | Widget minimized |
chat started | New conversation began |
message sent | Visitor message sent |
message received | Agent message received |
agent online | Agent available |
agent offline | Agent unavailable |
Installation
html
<!-- GTM Custom HTML Tag: Smartsupp Listener -->
<script>
(function() {
function smartPush(action, extra) {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push(Object.assign({
'event': 'SmartsuppChatEvent',
'chatAction': action,
'visitorID': window.smartsupp ? smartsupp('visitor:id') : ''
}, extra || {}));
}
var initSmartsupp = function() {
if (typeof window.smartsupp === 'undefined') return;
smartsupp('on', 'chat_open', function() { smartPush('chat widget opened'); });
smartsupp('on', 'chat_close', function() { smartPush('chat widget closed'); });
smartsupp('on', 'message_sent', function() { smartPush('message sent'); });
smartsupp('on', 'message_received', function() { smartPush('message received'); });
smartsupp('on', 'chat_start', function(e) {
smartPush('chat started', { chatSessionId: e ? e.data.sessionId : '' });
});
smartsupp('on', 'agent_online', function() { smartPush('agent online'); });
smartsupp('on', 'agent_offline', function() { smartPush('agent offline'); });
};
if (window.smartsupp) {
initSmartsupp();
} else {
window.addEventListener('load', initSmartsupp);
}
})();
</script>Fire on: Window Loaded.
Data Layer Output
json
{
"event": "SmartsuppChatEvent",
"chatAction": "chat started",
"visitorID": "visitor_abc123",
"chatSessionId": "session_xyz"
}Trigger Configuration
Trigger Type: Custom Event
Event Name: SmartsuppChatEvent
GA4 Mapping
| GA4 Event | Condition | Parameters |
|---|---|---|
chat_widget_open | chatAction = chat widget opened | chat_platform: "smartsupp" |