Skip to main content

Social Intents GTM Event Listener

Track Social Intents chat (Slack/Teams integration) in GTM. Monitor chat open, messages, and offline events with chatAction variable.

social-intentsslackteamschatgtmga4support

Event fired

socialIntents_Action

Key variable

chatAction

Social Intents

Overview

Social Intents routes website chat conversations directly to Slack, Microsoft Teams, or other platforms. This listener tracks widget interactions using Social Intents' JavaScript callback system.

Event fired: socialIntents_Action Variable: chatAction

Tracked Events

chatActionDescription
chat openedWidget expands
chat closedWidget collapses
message sentVisitor sends message
message receivedTeam replies via Slack/Teams
offline form submittedOffline contact form
pre-chat submittedPre-chat form
chat endedSession ends

Installation

html
<!-- GTM Custom HTML Tag: Social Intents Listener -->
<script>
(function() {
  function siPush(action, extra) {
    window.dataLayer = window.dataLayer || [];
    window.dataLayer.push(Object.assign({
      'event': 'socialIntents_Action',
      'chatAction': action
    }, extra || {}));
  }

  var initSI = function() {
    if (typeof window.socialIntents === 'undefined') return;
    socialIntents.on('open', function() { siPush('chat opened'); });
    socialIntents.on('close', function() { siPush('chat closed'); });
    socialIntents.on('messageSent', function() { siPush('message sent'); });
    socialIntents.on('messageReceived', function() { siPush('message received'); });
    socialIntents.on('offlineSubmit', function() { siPush('offline form submitted'); });
    socialIntents.on('prechatSubmit', function() { siPush('pre-chat submitted'); });
    socialIntents.on('chatEnded', function() { siPush('chat ended'); });
  };

  window.addEventListener('load', initSI);
})();
</script>

Data Layer Output

json
{
  "event": "socialIntents_Action",
  "chatAction": "message sent"
}

Trigger Configuration

Trigger Type: Custom Event Event Name: socialIntents_Action

Related Listeners