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_interactionsKey variable
tsActionTeam 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)
| tsAction | Description |
|---|---|
Close | Widget closes |
Open | Widget opens |
Minimize | Widget minimized |
ChatMessageSent | Visitor message |
ChatMessageReceived | Agent message |
MessageSubmit | Message form submitted |
StartChat | Conversation begins |
OpenProactive | Proactive chat opens |
ChatEnded | Chat session ends |
StartCallMe | Call-me request starts |
SwitchWidget | Widget mode switch |
Button | Button clicked |
RatingPromptClicked | Rating 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 Name | DL Key | Example |
|---|---|---|
| DLV – TS Action | tsAction | "StartChat" |
| DLV – TS Data | tsData | Object with context |
GA4 Mapping
| GA4 Event | Condition | Parameters |
|---|---|---|
chat_widget_open | tsAction = Open | chat_platform: "teamsupport" |
chat_request | tsAction = StartCallMe | method: "call" |