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).

1. Identify Web and Mobile WhatsApp Links
You likely have two types of links:
Desktop (Web WhatsApp): https://web.whatsapp.com/send?phone=+123456789&text=message
Mobile (WhatsApp App): https://wa.me/123456789?text=message
Your GTM trigger should capture both versions.
2. Create a Click Trigger in GTM
Go to Google Tag Manager.
Navigate to Triggers > Click New.
Set Trigger Type:
Choose Click – All Elements (for buttons, images, and links).
Trigger Conditions: Select Some Clicks and define the following condition: Click URL contains wa.me OR Click URL contains web.whatsapp.com
Save the Trigger and name it WhatsApp Click Trigger.
3. Create a GA4 Event Tag
Go to Tags > Click New.
Choose Google Analytics: GA4 Event.
Under Configuration Tag, select your GA4 Configuration Tag.
Event Name: whatsapp_click
Event Parameters:
Parameter Name: event_category, Value: WhatsApp
Parameter Name: event_action, Value: Click
Parameter Name: event_label, Value: {{Click URL}}
Triggering: Select WhatsApp Click Trigger.
Save the Tag.
4. Publish and Test in GTM
Click Submit in GTM.
Name the version (e.g., "WhatsApp Click Tracking").
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

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!
留言