Skip to main content

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_Event

Key variable

customerly_action

Customerly.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_actionDescription
widget openedChat widget opens
widget closedWidget closes
message sentVisitor sends message
message receivedAgent replies
email capturedEmail submitted
survey shownSurvey displayed
survey submittedSurvey completed
in-app message shownIn-app campaign shown
in-app message clickedCTA 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

Related Listeners