How to set up tawk.to for Google Analytics tracking

With Google Analytics tracking, you can keep an eye on your site’s activity and see results for custom events you set up with Google Tag Manager. For example, you can include custom events to track when a chat starts, when a chat ends or when a new ticket is created.

Prerequisites

Before setting up Google Analytics tracking for tawk.to, you’ll need the following:


  1. A Google Analytics account and property
  2. A tawk.to account

Retrieving the global site tag

Please note: If you already have the global site tag set up for your website, you can skip this section.


1 - Log in to your Google Analytics dashboard and navigate to Admin.

2 - In the Admin page, click on Setup Assistant under the Property column. This will open up a new panel.

3 - In the panel, find Tag installation and click on the > icon. That should open options for setting up a Data Stream.

4 - In the setup, select Web and a panel will appear.

5 - In the panel, enter your website’s URL and desired Data Stream name. Then click on Create stream.

6 - Next, the panel will redirect you to the stream details. From there you can find your Global site tag under Tagging instructions.

Sending Events to Google Analytics

To send custom events to your Google Analytics account, you can use the gtag object that was loaded from the global site tag (gtag.js).


For example, we can use the tawk.to onChatStarted JS API to send a chat_started event to your Google Analytics account. Place this code after your tawk.to widget code.

Was this article helpful?

10 out of 14 liked this article

Still need help? Message Us