top of page

Guide: Tracking WhatsApp Widget Clicks Using Google Tag Manager (GTM)

Dondy

This guide explains how to track clicks on your WhatsApp Widget when you have separate links for web and mobile, using Google Tag Manager (GTM).


google analytics and WhatsApp

1. Identify Web and Mobile WhatsApp Links


You likely have two types of links:

Your GTM trigger should capture both versions.


2. Create a Click Trigger in GTM


  1. Go to Google Tag Manager.

  2. Navigate to Triggers > Click New.

  3. Set Trigger Type:

    • Choose Click – All Elements (for buttons, images, and links).

  4. Trigger Conditions: Select Some Clicks and define the following condition: Click URL contains wa.me OR Click URL contains web.whatsapp.com

  5. Save the Trigger and name it WhatsApp Click Trigger.


3. Create a GA4 Event Tag


  1. Go to Tags > Click New.

  2. Choose Google Analytics: GA4 Event.

  3. Under Configuration Tag, select your GA4 Configuration Tag.

  4. Event Name: whatsapp_click

  5. Event Parameters:

    • Parameter Name: event_category, Value: WhatsApp

    • Parameter Name: event_action, Value: Click

    • Parameter Name: event_label, Value: {{Click URL}}

  6. Triggering: Select WhatsApp Click Trigger.

  7. Save the Tag.


4. Publish and Test in GTM


  1. Click Submit in GTM.

  2. Name the version (e.g., "WhatsApp Click Tracking").

  3. Click Preview and test if clicking the widget logs an event in GA4 > DebugView.


5. Optional: Track Mobile vs Desktop Separately


If you want separate tracking for web and mobile, modify the GA4 Event Parameters:

  • For Web:

    event_category: WhatsApp event_action: Click event_label: Web

    Trigger condition:

    Click URL contains web.whatsapp.com

  • For Mobile:

    event_category: WhatsApp event_action: Click event_label: Mobile

    Trigger condition:

    Click URL contains wa.me



WhatsApp google tag

Then, create two different GA4 tags in GTM, one for web and one for mobile.

Now GTM will track WhatsApp clicks separately for desktop and mobile, with no need to modify your website code!


If you want to add a WhatsApp widget for free to your Shopify store, check out Dondy!

 
 
 

留言


bottom of page