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_ActionKey variable
ChatActionUserlike 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
| ChatAction | Description |
|---|---|
panel opened | Chat widget opens |
panel closed | Chat widget closes |
conversation started | Chat initiated |
message sent | Visitor message |
message received | Operator reply |
rating submitted | Chat rated |
offline contact submitted | Offline form sent |
feedback submitted | Post-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 Name | DL Key | Example |
|---|---|---|
| DLV – Userlike Action | ChatAction | "conversation started" |
| DLV – Userlike Widget ID | ChatWidgetID | "widget_key_abc" |