Skip to main content

Userlike Chat GTM Event Listener

Track Userlike chat widget interactions in GTM. Monitor panel open/close, conversation start, messages, ratings, and offline contact with ChatAction and ChatWidgetID.

userlikechatgdprgtmga4supportgermanyeurope

Event fired

Userlike_Action

Key variable

ChatAction

Userlike Chat

Overview

Userlike is a GDPR-compliant live chat solution based in Germany, popular with European businesses. This listener hooks into Userlike's JavaScript API events to track widget interactions.

Event fired: Userlike_Action Variables: ChatAction, ChatWidgetID

GDPR Note

Userlike is built with GDPR in mind. When implementing this listener, ensure you align data layer pushes with your consent management platform (CMP) consent state, especially when capturing any user data.

Tracked Events

ChatActionDescription
panel openedChat widget opens
panel closedChat widget closes
conversation startedChat initiated
message sentVisitor message
message receivedOperator reply
rating submittedChat rated
offline contact submittedOffline form sent
feedback submittedPost-chat feedback

Installation

html
<!-- GTM Custom HTML Tag: Userlike Listener -->
<script>
(function() {
  function ulPush(action, extra) {
    window.dataLayer = window.dataLayer || [];
    window.dataLayer.push(Object.assign({
      'event': 'Userlike_Action',
      'ChatAction': action,
      'ChatWidgetID': window.userliker ? userliker.config.widgetKey : ''
    }, extra || {}));
  }

  var initUserlike = function() {
    if (typeof window.userliker === 'undefined') return;
    userliker.on('chatPanel:open', function() { ulPush('panel opened'); });
    userliker.on('chatPanel:close', function() { ulPush('panel closed'); });
    userliker.on('conversation:start', function() { ulPush('conversation started'); });
    userliker.on('message:send', function() { ulPush('message sent'); });
    userliker.on('message:receive', function() { ulPush('message received'); });
    userliker.on('rating:submit', function(data) {
      ulPush('rating submitted', { chatRating: data.rating });
    });
    userliker.on('offlineContact:submit', function() { ulPush('offline contact submitted'); });
    userliker.on('feedback:submit', function() { ulPush('feedback submitted'); });
  };

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

Data Layer Output

json
{
  "event": "Userlike_Action",
  "ChatAction": "conversation started",
  "ChatWidgetID": "widget_key_abc"
}

Trigger Configuration

Trigger Type: Custom Event Event Name: Userlike_Action

Variables to Capture

Variable NameDL KeyExample
DLV – Userlike ActionChatAction"conversation started"
DLV – Userlike Widget IDChatWidgetID"widget_key_abc"

Related Listeners