Customerly GTM Event Listener
Track Customerly.io chat interactions in GTM. Monitor widget open, messages, email capture, survey responses, and in-app messages with customerly_action variable.
customerlychatcrmemail-marketinggtmga4saas
Event fired
customerly_EventKey variable
customerly_actionCustomerly.io
Overview
Customerly is a customer relationship platform combining live chat, email marketing, surveys, and in-app messaging. This listener tracks interactions across all these channels.
Event fired: customerly_Event
Variable: customerly_action
Tracked Events
| customerly_action | Description |
|---|---|
widget opened | Chat widget opens |
widget closed | Widget closes |
message sent | Visitor sends message |
message received | Agent replies |
email captured | Email submitted |
survey shown | Survey displayed |
survey submitted | Survey completed |
in-app message shown | In-app campaign shown |
in-app message clicked | CTA clicked in campaign |
Installation
html
<!-- GTM Custom HTML Tag: Customerly Listener -->
<script>
(function() {
function custPush(action, extra) {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push(Object.assign({
'event': 'customerly_Event',
'customerly_action': action
}, extra || {}));
}
var initCustomerly = function() {
if (typeof window.customerly === 'undefined') return;
customerly.on('widget:open', function() { custPush('widget opened'); });
customerly.on('widget:close', function() { custPush('widget closed'); });
customerly.on('message:sent', function() { custPush('message sent'); });
customerly.on('message:received', function() { custPush('message received'); });
customerly.on('lead:email', function(data) {
custPush('email captured', { visitorEmail: data.email });
});
customerly.on('survey:show', function() { custPush('survey shown'); });
customerly.on('survey:submit', function(data) {
custPush('survey submitted', { surveyResponse: data });
});
};
window.addEventListener('load', initCustomerly);
})();
</script>Data Layer Output
json
{
"event": "customerly_Event",
"customerly_action": "email captured",
"visitorEmail": "user@example.com"
}Trigger Configuration
Trigger Type: Custom Event
Event Name: customerly_Event