Hello 👋 How can we help?

Track chat events with Google Analytics

Track chat events with GA.
Written by Artem
Updated 4 days ago

If you want to track HelpCrunch chat/widget events in your Google Analytics account, you can easily add tracking codes to your web page with HelpCrunch widget. For example, if your Google Analytics function is “ga” (default one) you will need to add these codes after HelpCrunch(‘init’): Track when your customer sends a message in chat with onCustomerMessage event:

HelpCrunch('onCustomerMessage', function (event) {
  ga('send', 'event', 'customer', 'sendChatMessage');
});

Track when your customer opens the chat:

HelpCrunch('onChatOpen', function () {
  ga('send', 'event', 'customer', 'opensChat');
});

Track when your customer closes the chat:

HelpCrunch('onChatClose', function () {
  ga('send', 'event', 'customer', 'opensChat');
});

Track when your customer receives a new message with onNewUnreadMessage event: 

HelpCrunch('onNewUnreadMessages', function () {
  ga('send', 'event', 'customer', 'getsNewMessage');
});

If you want to track any other event in Google Analytics – please contact us in chat from your HelpCrunch admin account and we will arrange it for you.

Did this answer your question?