Track Tawk.to Chat Engagement in Google Analytics through Google Tag Manager

Thảo luận trong 'Automation Marketing' bắt đầu bởi KetHuynh, 10/8/17.

  1. KetHuynh

    KetHuynh Administrator Thành viên BQT

    Tawk.to is getting popular very quickly as a free chat web application. Here’s an easy way to add the service to your website through Google Tag Manager and send an event to Google Analytics when a chat starts.

    Let’s begin by adding the Tawk.to widget to our site with GTM. Go to Admin and copy your widget code:

    [​IMG]

    Now we’ll create a custom HTML tag in GTM and fire it on all pages.

    [​IMG]

    This will show the Tawk.to chat pop up on every page of the site.

    Let’s add the chat interaction tracking in another custom HTML tag:

    [​IMG]

    Here’s the code I’m using:

    <script type="text/javascript">Tawk_API.onChatStarted =function(){if(Tawk_API.isVisitorEngaged()){
    window.dataLayer = window.dataLayer ||[];
    dataLayer.push({'event':'chat-started'});}};</script>
    There’s also Tag Sequencing setting to fire our main Tawk.to tag before this Tawk.to engagement tag.

    And the last tag we’ll create is the GA event tag for chat interaction, which will fire on the chat-started event:

    [​IMG]

    We can go to Preview mode and test it. When we started a chat, the chat-started event appeared in the events column of the GTM Debug console and our Chat engagement GA tag was fired:

    [​IMG]

    We also see the event coming in Google Analytics real-time reports:

    [​IMG]

    From here you can use the event to setup a goal in GA, import it into AdWords or add AdWords / Facebook conversion tracking for the chat interaction activity. Hope you’ll find this useful and try it yourself.
     

Chia sẻ trang này