Skip to main content

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

SmartsuppChatEvent

Key variable

chatAction

Smartsupp 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 ValueDescription
chat widget openedWidget expanded
chat widget closedWidget minimized
chat startedNew conversation began
message sentVisitor message sent
message receivedAgent message received
agent onlineAgent available
agent offlineAgent 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 EventConditionParameters
chat_widget_openchatAction = chat widget openedchat_platform: "smartsupp"

Related Listeners