Skip to main content

Crisp Chat GTM Event Listener

Track 7 Crisp chat interactions in Google Tag Manager including chat initiated, messages sent/received, email capture, helpdesk queries. Capture CrispSessionID and CrispEmail.

crispchatgtmga4supportlead-generation

Event fired

CrispInteractions

Crisp Chat

Overview

Crisp is a multi-channel customer messaging platform. This listener hooks into Crisp's JavaScript API to capture 7 distinct user interactions, from widget open/close to email capture and helpdesk queries.

Event fired: CrispInteractions

Variables:

  • chatAction, the specific interaction type
  • CrispSessionID, unique session identifier
  • CrispEmail, user-submitted email
  • CrispPhone, user phone number

Common Use Cases

  • Track chat engagement rates (opens vs. messages sent)
  • Capture email addresses from Crisp for Enhanced Conversions
  • Build audiences of users who contacted support
  • Measure helpdesk query volume in GA4
  • Correlate chat usage with conversion metrics

Tracked Events

chatAction ValueTrigger
chat initiatedUser clicks chat widget
chat widget openedWidget expands
chat widget closedWidget collapses
message sentUser sends a message
message receivedAgent replies
email capturedUser submits email
helpdesk queryUser searches knowledge base

Installation

html
<!-- GTM Custom HTML Tag: Crisp Chat Listener -->
<script>
(function() {
  function crispPush(action, extra) {
    window.dataLayer = window.dataLayer || [];
    var push = {
      'event': 'CrispInteractions',
      'chatAction': action,
      'CrispSessionID': window.$crisp ? $crisp.get('session:identifier') : '',
      'CrispEmail': window.$crisp ? ($crisp.get('user:email') || '') : '',
      'CrispPhone': window.$crisp ? ($crisp.get('user:phone') || '') : ''
    };
    if (extra) Object.assign(push, extra);
    window.dataLayer.push(push);
  }

  window.CRISP_READY_TRIGGER = function() {
    window.$crisp.push(['on', 'chat:initiated', function() { crispPush('chat initiated'); }]);
    window.$crisp.push(['on', 'chat:opened', function() { crispPush('chat widget opened'); }]);
    window.$crisp.push(['on', 'chat:closed', function() { crispPush('chat widget closed'); }]);
    window.$crisp.push(['on', 'message:sent', function() { crispPush('message sent'); }]);
    window.$crisp.push(['on', 'message:received', function() { crispPush('message received'); }]);
    window.$crisp.push(['on', 'user:email:changed', function() { crispPush('email captured'); }]);
    window.$crisp.push(['on', 'helpdesk:queried', function() { crispPush('helpdesk query'); }]);
  };
})();
</script>

Fire on: All Pages (DOM Ready).

Data Layer Output

json
{
  "event": "CrispInteractions",
  "chatAction": "email captured",
  "CrispSessionID": "session_abc123",
  "CrispEmail": "user@example.com",
  "CrispPhone": "+1234567890"
}

Trigger Configuration

All Crisp Events

Trigger Type: Custom Event Event Name: CrispInteractions

Conversion-Only (Message Sent)

Trigger Type: Custom Event Event Name: CrispInteractions Condition: DLV – Chat Action | equals | message sent

Variables to Capture

Variable NameDL KeyExample
DLV – Crisp ActionchatAction"message sent"
DLV – Crisp Session IDCrispSessionID"session_abc123"
DLV – Crisp EmailCrispEmail"user@example.com"

GA4 Mapping

GA4 EventTrigger ConditionParameters
chat_widget_openchatAction = chat widget openedchat_platform: "crisp"
generate_leadchatAction = email capturedchat_platform, email

Debugging

ProblemCauseFix
$crisp is not definedCrisp not loadedUse Window Loaded trigger
CRISP_READY_TRIGGER not calledCrisp init after listenerAdd fallback check on window.load

Related Listeners