How to add Google Analytics Event Tracking code on Leave a message button

We want to track click events in Google analytics. So how we can add the Event tracking code on the button on live chat. Please advise.

Hello @customearthpromos!

If you’d like to track the click on your Leave a message button, all that you have to do is to make sure that you have installed our official Google Analytics integration and that you have both, LiveChat’s and Google Analytics codes on your website! :slight_smile:

Our official integration automatically tracks the following events, sending them to your Google Analytics dashboard:

  1. Automated greeting - every time visitor is greeted
  2. Pre-chat survey - when pre-chat is displayed
  3. Chat - when chat starts
  4. After-hours form/Ticket form - when ticket form is viewed
  5. Post-chat survey - when after-chat survey is displayed

If you will have any problems with setting up the GA integration, don’t hesitate to check out our official integration tutorial: https://www.livechatinc.com/kb/log-live-chat-data-with-google-analytics/

Also, if you’d like to track other custom events and/or interactions that your customers have with your chat widget, you can check out our official JS API documentation: https://developers.livechatinc.com/docs/js-api/#introduction – this documentation provides you with all the methods and callbacks that are available at LiveChat, and you can bind them with your event tracking code.

@customearthpromos I hope that I was able to help! Feel free to ask in case of any additional questions and we will do our best to clear any doubts about this topic :male_detective:

1 Like

It was of great help. We have installed the updated code to track our events in Analytics. Hope it will start working. In case of any help, i will get in touch. Thanks much Krzysztof

3 Likes