Track WhatsApp Button Clicks in Google Tag Manager (GA4)

Track WhatsApp button clicks in Google Tag Manager: a link-click trigger for wa.me links and a custom event that also catches Click to Chat and Joinchat.

Updated Oct 24, 2026 4 min read
On this page
  1. Two ways to track WhatsApp clicks in Tag Manager
  2. What you need
  3. Setup 1: a link-click trigger for plain WhatsApp links
  4. Setup 2: a custom event that also catches chat widgets
  5. Step 1: Install WhatsLink Click Tracker
  6. Step 2: Add a listener tag
  7. Step 3: Create two data layer variables
  8. Step 4: Create the trigger
  9. Step 5: Send it to GA4
  10. Step 6: Test and publish
  11. Send the same click to Google Ads or Meta
  12. Mistakes to avoid
  13. Read next
  14. FAQ
  15. Official sources

Two ways to track WhatsApp clicks in Tag Manager

Google Tag Manager has no WhatsApp trigger. You can build one from a link-click trigger, which works for plain wa.me, api.whatsapp.com, and web.whatsapp.com links. If your site uses a chat widget, you need an event that fires when the widget opens WhatsApp. This guide covers both.

What you need

A Tag Manager container on your site and a GA4 property (or a Google Ads account). For the second setup, the free WhatsLink Click Tracker plugin, version 1.6.0 or later.

Use this if every WhatsApp button on your site is a real link to wa.me, api.whatsapp.com, or web.whatsapp.com.

  1. In Tag Manager, open Variables → Configure and enable the built-in Click URL variable.
  2. Go to Triggers → New and choose Click – Just Links. Select Some Link Clicks and set Click URL matches RegEx wa\.me|whatsapp\.com. This covers wa.me, api.whatsapp.com, and web.whatsapp.com, which some chat plugins use on desktop.
  3. Go to Tags → New → Google Analytics: GA4 Event. Enter your Measurement ID, set the event name to whatsapp_click, and add a parameter link_url with the value {{Click URL}}.
  4. Attach the trigger, save, and test in Preview mode.

The limit: a link-click trigger needs a link. Many chat widgets, such as Click to Chat, Joinchat and WP Social Chat, show a button that opens WhatsApp from JavaScript, with no link to click. For those, the trigger never fires.

Setup 2: a custom event that also catches chat widgets

The free WhatsLink Click Tracker plugin (1.6.0 or later) detects WhatsApp, Telegram, and phone clicks on links and on chat widgets, and announces each one with a whatslink:click event in the browser. These steps pass it to Tag Manager.

Install and activate it from Plugins → Add New. It needs no settings: it starts detecting clicks right away and keeps its own click log in WordPress.

Step 2: Add a listener tag

Create a Custom HTML tag with this code and an Initialization trigger that fires on All Initialization Events:

<script>
  document.addEventListener('whatslink:click', function (event) {
    window.dataLayer = window.dataLayer || [];
    window.dataLayer.push({
      event: 'whatslink_click',
      whatslink_channel: event.detail.channel,
      whatslink_url: event.detail.url
    });
  });
</script>

Every click now pushes a whatslink_click event to the data layer, with the channel (whatsapp, telegram, or phone) and the clicked link.

Step 3: Create two data layer variables

Under Variables, in User-Defined Variables, click New and choose Data Layer Variable. Create one with the name whatslink_channel and one with whatslink_url. The steps below call them DLV - whatslink_channel and DLV - whatslink_url.

Step 4: Create the trigger

Under Triggers → New → Custom Event, set the event name to whatslink_click. To track WhatsApp only, choose Some Custom Events with DLV - whatslink_channel equals whatsapp.

Step 5: Send it to GA4

Create a Google Analytics: GA4 Event tag with the event name {{DLV - whatslink_channel}}_click, which becomes whatsapp_click, telegram_click, or phone_click, and a parameter link_url set to {{DLV - whatslink_url}}. Attach the trigger from Step 4.

Step 6: Test and publish

Open Preview, click a WhatsApp button on your site, and check in Tag Assistant that whatslink_click appears and your GA4 tag fires once. Then publish the container.

Diagram of Setup 2: the whatslink:click browser event, the listener tag pushing whatslink_click to the data layer, the two data layer variables, the Custom Event trigger filtered to WhatsApp and the GA4 Event tag that sends whatsapp_click with link_url
Setup 2 step by step: the names each step passes on, from the click to the whatsapp_click event in GA4.

Send the same click to Google Ads or Meta

The trigger from Step 4 works for any tag:

  • Google Ads: add a Google Ads Conversion Tracking tag with the conversion ID and label of a conversion action. How to create one is in WhatsApp Conversion Tracking for Google Ads and Meta Ads.
  • Meta Pixel: if the pixel is already on your site, a Custom HTML tag with <script>fbq('track', 'Contact');</script> sends the standard Contact event.

Prefer not to maintain tags? WhatsLink PRO sends the same clicks to GA4, Google Ads, and the Meta Pixel from its Ad Conversions page. Use one approach, not both, or each click is counted twice.

Mistakes to avoid

  • Counting twice. If GA4’s enhanced measurement Outbound clicks is on, wa.me clicks also appear as a generic “click” event. That is fine as long as you only mark whatsapp_click as a key event.
  • Firing the listener late. Keep the listener tag on an Initialization trigger, so it is ready before the visitor clicks.
  • Typos in event names. Names are case-sensitive: whatslink_click in the data layer, whatsapp_click in GA4.
  • Consent. If your consent setup blocks these tags for visitors who decline, their clicks are not sent to GA4 or Google Ads. WhatsLink’s own click log in WordPress still records them, without IP addresses or location.

What WhatsLink Click Tracker gives you for free

  • Detects WhatsApp, Telegram, and phone clicks on links and chat widgets
  • A whatslink:click event for Tag Manager or your own code
  • A click log in WordPress with page, link, UTM parameters, and referrer
  • No IP addresses or location stored
  • Works with Click to Chat, Joinchat, Chaty, and WP Social Chat
Get WhatsLink free

FAQ

Why doesn't my GTM click trigger fire for my WhatsApp chat widget?

Most chat widgets show a button that opens WhatsApp from JavaScript instead of a link. Click - Just Links triggers only see links, and an All Elements trigger catches the click on the button but not whether it opened WhatsApp. Use an event that fires when WhatsApp is opened, such as WhatsLink's whatslink:click.

Does the whatslink:click event work for Telegram and phone links?

Yes. It fires for WhatsApp, Telegram (t.me), and phone (tel:) clicks, with the channel in event.detail.channel. Filter on it in your trigger if you only want WhatsApp.

Will the click be counted twice?

Only if two setups send the same event. Don't combine a link-click trigger and the custom event for the same GA4 event name, and don't add GTM tags for clicks that WhatsLink PRO's Ad Conversions already sends.

Can I send WhatsApp clicks to Google Ads from Tag Manager?

Yes. Use the same trigger with a Google Ads Conversion Tracking tag and the conversion ID and label of a conversion action in your Google Ads account.

Do I need Tag Manager to use WhatsLink?

No. WhatsLink Click Tracker logs clicks in WordPress on its own. Tag Manager is only needed to pass the clicks to other tools, and WhatsLink PRO can do that without it.

Official sources

Related guides