Skip to main content

TeamSupport Chat GTM Event Listener

Track TeamSupport chat interactions in GTM. Monitor 13 events including chat open/close, messages, ratings, call-me requests with tsAction and tsData variables.

teamsupportb2bchatgtmga4supportenterprise

Event fired

teamSupport_interactions

Key variable

tsAction

Team Support Chat

Overview

TeamSupport is a B2B customer support platform with chat, ticketing, and customer management. This listener tracks 13 interaction types using TeamSupport's JavaScript API.

Event fired: teamSupport_interactions Variables: tsAction, tsData

Tracked Events (13 Total)

tsActionDescription
CloseWidget closes
OpenWidget opens
MinimizeWidget minimized
ChatMessageSentVisitor message
ChatMessageReceivedAgent message
MessageSubmitMessage form submitted
StartChatConversation begins
OpenProactiveProactive chat opens
ChatEndedChat session ends
StartCallMeCall-me request starts
SwitchWidgetWidget mode switch
ButtonButton clicked
RatingPromptClickedRating displayed

Installation

html
<!-- GTM Custom HTML Tag: TeamSupport Listener -->
<script>
(function() {
  function tsPush(action, data) {
    window.dataLayer = window.dataLayer || [];
    window.dataLayer.push({
      'event': 'teamSupport_interactions',
      'tsAction': action,
      'tsData': data || {}
    });
  }

  var tsEvents = [
    'Close', 'Open', 'Minimize', 'ChatMessageSent', 'ChatMessageReceived',
    'MessageSubmit', 'StartChat', 'OpenProactive', 'ChatEnded',
    'StartCallMe', 'SwitchWidget', 'Button', 'RatingPromptClicked'
  ];

  var initTS = function() {
    if (typeof window.TeamSupportChat === 'undefined') return;
    tsEvents.forEach(function(ev) {
      TeamSupportChat.on(ev, function(data) { tsPush(ev, data); });
    });
  };

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

Data Layer Output

json
{
  "event": "teamSupport_interactions",
  "tsAction": "StartChat",
  "tsData": {
    "agentName": "Sarah",
    "message": "Hello, how can I help?",
    "visitorEmail": "customer@company.com"
  }
}

Trigger Configuration

Trigger Type: Custom Event Event Name: teamSupport_interactions

Per event:

Condition: DLV – TS Action | equals | StartChat

Variables to Capture

Variable NameDL KeyExample
DLV – TS ActiontsAction"StartChat"
DLV – TS DatatsDataObject with context

GA4 Mapping

GA4 EventConditionParameters
chat_widget_opentsAction = Openchat_platform: "teamsupport"
chat_requesttsAction = StartCallMemethod: "call"

Related Listeners