This article explains how you can send Crisp's users events to Google Analytics using Google Tag Manager (or not).

We will cover a few examples but regarding Google Analytics developpers docs you will be able to set a wide variety of use case. Depending on the way you use Crisp, you should be able to build users events for support, marketing & sales teams.

If you want to have a look at all the events that are built in Crisp, you should have a look here.

For Google Tag Manager, you'll need first, to create an event listener (containing the event you want to track with Crisp) and a trigger on a personalized event called "gtm.click". You'll then have to create a personalized event called "CrispInteractions" that enables the Google Analytics triggers to send data.

Chatbox has been loaded

This event helps you to monitor how many times a chatbox has been loaded.
For this event, we use the [chat:initiated]

If you are using Google Tag Manager :

<script type="text/javascript">
$crisp.push(["on", "chat:initiated", function(event){
{
dataLayer.push({
'event': 'CrispInteractions',
'eventCategory': 'chatbox',
'eventAction': 'Chat Initiated'
});
};
}]);
</script>


If you are using Universal Analytics (analytics.js) :

<script type="text/javascript">$crisp.push(["on", "chat:initiated", function(){ ga('send', 'event', 'Chat', 'Chat-Initiated');}]);</script>

Chatbox has been opened

This event helps you to monitor how many times a chatbox has been opened.
For this event, we use the [chat:opened]

If you are using Google Tag Manager :

<script type="text/javascript">
$crisp.push(["on", "chat:opened", function(event){
{
dataLayer.push({
'event': 'CrispInteractions',
'eventCategory': 'chatbox',
'eventAction': 'chat opened'
});
};
}]);
</script>


If you are using Universal Analytics (analytics.js) :

<script type="text/javascript">$crisp.push(["on", "chat:opened", function(){ ga('send', 'event', 'Chat', 'Chat opened');}]);</script>

Chatbox has been closed

This event helps you to monitor how many times a chatbox has been closed.
For this event, we use the [chat:closed]

If you are using Google Tag Manager :

<script type="text/javascript">
$crisp.push(["on", "chat:closed", function(event){
{
dataLayer.push({
'event': 'CrispInteractions',
'eventCategory': 'chatbox',
'eventAction': 'chat closed'
});
};
}]);
</script>


If you are using Universal Analytics (analytics.js) :

<script type="text/javascript">$crisp.push(["on", "chat:closed", function(){ ga('send', 'event', 'Chat', 'Chat closed');}]);</script>

A message has been sent

This event helps you to monitor how many messages have been sent through Crisp.
For this event, we use the [message:sent]

If you are using Google Tag Manager :

<script type="text/javascript">
$crisp.push(["on", "message:sent", function(event){
{
dataLayer.push({
'event': 'CrispInteractions',
'eventCategory': 'chatbox',
'eventAction': 'message sent'
});
};
}]);
</script>


If you are using Universal Analytics (analytics.js) :

<script type="text/javascript">$crisp.push(["on", "message:sent", function(){ ga('send', 'event', 'Chat', 'Message Sent');}]);</script>

A message has been received

This event helps you to monitor how many messages have been received through Crisp.
For this event, we use the [message:received]

If you are using Google Tag Manager :

<script type="text/javascript">
$crisp.push(["on", "message:received", function(event){
{
dataLayer.push({
'event': 'CrispInteractions',
'eventCategory': 'chatbox',
'eventAction': 'message received'
});
};
}]);
</script>


If you are using Universal Analytics (analytics.js) :

<script type="text/javascript">$crisp.push(["on", "message:received", function(){ ga('send', 'event', 'Chat', 'Message Received');}]);</script>

Or, you can simply use our Zapier integration with Google Analytics

Here is an example of what you should in order to track [message:sent]

Step 1 : Build an event listener as explain beneath

Crisp event listener based on Javascript SDK

Step 2 : Create a custom event that listens to the right action you are tracking (beware, gtm.click is only available if you track message sent, otherwise, you would want to use gtm.dom)

Custom Event

Step 3 : Once you've pushed the event when a message is sent, use that event to triggers a google analytics event.

Crisp Interactions

Step 4 : Just link the custom event with an analytics property that will send the right data to your google analytics account.

Google Analytics event for message sent
Was this article helpful?
Cancel
Thank you!