Short answer: To track WhatsApp leads in GA4 and a CRM, treat it as three separate measurements. (1) Record the website click on a wa.me button as a GA4 event through Google Tag Manager. (2) Join the chat to its campaign: put a short reference code in the prefilled message for website traffic, and read the referral object and ctwa_clid from the WhatsApp Cloud API webhook for click-to-WhatsApp ads. (3) Let the CRM record qualification and sale, then send those outcomes back to GA4 (Measurement Protocol), Google Ads and Meta. GA4 alone never sees the conversation.
Need this done for you? GrowthSparx offers a fixed-scope lead tracking and attribution setup: GA4, Google Ads, Meta, WhatsApp, calls and CRM wired into one dashboard, usually live in 2–3 weeks.
Benchmark reference: the public 2025–2026 numbers behind this guide (Meta and Google CPC/CPM in India, CPL ranges by industry, landing-page conversion, real estate funnel rates, WhatsApp API pricing) are collected and graded in our India lead generation benchmarks 2026 report.
How do WhatsApp leads arrive, and what can each path be tracked with?
Most Indian lead-gen businesses get WhatsApp leads through three doors. Each needs a different tracking method, and mixing them up is the commonest reason WhatsApp shows up as "direct" or "unknown" in reports.
| Entry path | Example | What identifies the source | Where it is recorded |
|---|---|---|---|
| Website button or floating icon | "Chat on WhatsApp" on a project landing page | UTMs and click IDs from the landing session, joined via a reference code in the prefilled message | GA4 (click), CRM (chat and outcome) |
| Click-to-WhatsApp ad | Meta ad with a "Send message" button opening WhatsApp | referral.source_id (ad ID) and ctwa_clid in the webhook | CRM and Meta; never touches your website or GA4 |
| Offline or untagged | QR code on a hoarding, number on a brochure, number saved from a portal listing | A distinct prefilled message or number per medium | CRM only |
This guide assumes your chats land in a WhatsApp Business API inbox or CRM that receives webhooks. On the free WhatsApp Business app there are no webhooks, so steps 2 and 3 become manual tagging by the sales team. If you are still choosing, see WhatsApp Business app vs API vs CRM.
How do you track WhatsApp button clicks in GA4?
A WhatsApp click-to-chat link has the format https://wa.me/<number>, with the number in full international format and no zeros, brackets or dashes, and an optional prefilled message as ?text= with URL-encoded text (WhatsApp Help Center). For an Indian number: https://wa.me/919876543210?text=Hi%2C%20I%20want%20details. Our WhatsApp link generator builds these.
GA4's enhanced measurement already logs a click event with outbound=true and link_url when someone clicks a link to another domain (Google Analytics Help). That is fine for a quick look, but it lumps WhatsApp in with every other outbound link and does not tell you which button was tapped. Set up a dedicated event in Google Tag Manager instead:
- Add a data attribute to each button so you know where it sits, for example
<a href="https://wa.me/91..." data-wa-location="hero">,"sticky_footer","pricing_table". - Create a trigger: Triggers → New → Click – Just Links. Fire on Some Link Clicks where Click URL matches RegEx
wa\.me|api\.whatsapp\.com|whatsapp://. Google's click trigger documentation explains the Just Links type and its Wait for Tags and Check Validation options. Leave Wait for Tags on; the click opens a new app and can cut the hit short on mobile. - Create a variable of type Auto-Event Variable → Element Attribute, attribute
data-wa-location. - Create the tag: Google Analytics: GA4 Event, event name
whatsapp_click, parameterswa_location= the variable above,wa_ref= the reference code (next section),page_location= Page URL. - Register custom dimensions in GA4 Admin for
wa_locationandwa_ref(event scope), or they will not appear in standard reports. - Test in GTM Preview and GA4 DebugView on a real phone: one tap must produce exactly one
whatsapp_click.
Should it be a key event? We mark whatsapp_click as a key event for reporting but do not import it into Google Ads as a primary conversion. A tap is intent, not a lead: people tap, see the app open, and close it. Keep generate_lead for confirmed enquiries, as set out in our GA4 lead generation tracking setup.
Never put the phone number or message text in GA4. Google's policies say no data may be passed that Google could recognise as personally identifiable, explicitly including "email addresses, personal mobile numbers" (GA4 PII policy). Your own business number in link_url is fine; the visitor's number is not.
How do you connect a WhatsApp chat to the campaign that drove it?
The GA4 click and the incoming WhatsApp message are two unconnected records: one has UTMs but no person, the other has a person but no UTMs. A reference code in the prefilled message joins them. This is the method we implement most often:
- On page load, generate a short code (5–6 characters, for example
K7Q2M) and store it in a first-party cookie alongside the session'sutm_source,utm_medium,utm_campaign,gclid,gbraid,wbraid,fbclid, landing page and the GA4 client ID (from the_gacookie). - Rewrite the WhatsApp link so the prefilled text ends with the code: "Hi, I'd like details on 3 BHK in Sector 150. Ref: K7Q2M".
- On click, send the same payload to your server (or a small webhook, a Google Sheet via Apps Script, or the CRM's web-to-lead endpoint) so the code is stored with its attribution before the chat starts.
- When the message arrives, the inbox or CRM looks for
Ref: XXXXX, finds the stored attribution and writes it onto the new lead.
A minimal version of the client-side part:
var ref = getCookie('wa_ref') || Math.random().toString(36).slice(2,7).toUpperCase();setCookie('wa_ref', ref, 30);document.querySelectorAll('a[href*="wa.me"]').forEach(function(a){var u = new URL(a.href); var t = u.searchParams.get('text') || 'Hi';u.searchParams.set('text', t + ' Ref: ' + ref); a.href = u.toString();});dataLayer.push({event: 'wa_ref_ready', wa_ref: ref});
Practical rules: keep the code at the end so people are less likely to delete it; measure how many chats arrive without a code on your own traffic, and record those as "website – ref missing" rather than "direct". Use a different fixed code per offline medium, such as HOARDING-NOIDA or BROCHURE-EXPO, for QR codes.
How do you track leads from click-to-WhatsApp ads?
Click-to-WhatsApp ads skip your website entirely, so GA4 and the reference-code method do not apply. Meta passes the source in the webhook instead. When a chat starts from one of these ads, the WhatsApp Cloud API messages webhook includes a referral object with source_id (the ad ID), source_type (ad), source_url, headline, body and ctwa_clid, the ad click ID (Meta webhook reference). A trimmed example:
"messages": [{ "from": "919876543210", "type": "text","referral": { "source_type": "ad", "source_id": "23849103758201934","headline": "Message our team", "ctwa_clid": "Afq9KxR2..." },"text": { "body": "Is the 2 BHK still available?" } }]
Map these to CRM fields on lead creation: source = meta_ctwa, meta_ad_id = source_id, ctwa_clid, and the first message. Two caveats from Meta's reference: the referral object is attached only to messages sent through a click-to-WhatsApp ad, so write it to the lead when the chat starts rather than looking for it later; and ctwa_clid "is omitted entirely for messages originating from an ad in WhatsApp Status". Store the ad ID even when the click ID is missing.
If you use a BSP inbox rather than your own webhook, check that it writes these fields to the contact record rather than only showing the ad preview in the chat window. Our WhatsApp CRM integration guide covers the integration itself.
What should the WhatsApp lead record in the CRM contain?
| Field | Source | Used for |
|---|---|---|
| wa_id / phone (E.164, e.g. +919876543210) | Webhook from | Contact identity; hashed match key for Google and Meta uploads |
| entry_path (website / ctwa / offline) | Rule on creation | Splitting reports by door |
| wa_ref | Parsed from first message | Joining to stored web attribution |
| utm_source, utm_medium, utm_campaign, landing_page | Lookup on wa_ref | Channel and campaign reporting |
| gclid / gbraid / wbraid | Lookup on wa_ref | Google Ads conversion import |
| ga_client_id | Lookup on wa_ref | Sending outcomes to GA4 via Measurement Protocol |
| meta_ad_id, ctwa_clid | Webhook referral | Meta Conversions API for business messaging |
| first_message_at, first_reply_at | Webhook timestamps | Response-time tracking |
| status, qualified_at, won_at, deal_value, rejection_reason | Sales team | Outcome events and quality analysis |
| marketing opt-in (yes/no, date, wording) | Chat flow or form | Permission for template messages |
Create the lead on the first inbound message, not on the first click. One contact may start several chats over months; keep one contact with multiple enquiries rather than duplicate contacts.
How do you send qualified WhatsApp leads back to GA4, Google Ads and Meta?
GA4. Google's recommended lead events include qualify_lead, working_lead and close_convert_lead (recommended events). Send them from the CRM with the Measurement Protocol: an HTTP POST to https://www.google-analytics.com/mp/collect?measurement_id=G-XXXX&api_secret=... with the stored client_id. Google notes the API secret must stay server-side and events can be backdated by up to 72 hours (Measurement Protocol guide), so send stage changes daily. In the example below, 9000 is an illustrative value per qualified lead, not a benchmark.
{"client_id": "1234567890.1728000000","events": [{"name": "qualify_lead","params": {"currency": "INR", "value": 9000, "lead_source": "whatsapp"}}]}
Google Ads. If the stored attribution includes a GCLID, or you have the phone number, upload the qualified or converted stage as an offline conversion. WhatsApp gives you the phone in E.164 already, which suits enhanced conversions for leads, where Google matches hashed phone and email.
Meta. For click-to-WhatsApp ads, send events through the Conversions API for business messaging with action_source: "business_messaging", messaging_channel: "whatsapp", and user_data containing your whatsapp_business_account_id and the ctwa_clid. Supported event names include LeadSubmitted, QualifiedLead and Purchase. Meta states it does not deduplicate these events, so send each stage once, and that they should represent interactions in the messaging thread (Meta for Developers). Website-originated WhatsApp leads go through the standard CAPI route described in tracking Meta ads leads to CRM and sales.
Each template or service message you send while qualifying the lead has a cost on the API; current India rates are in our WhatsApp Business API cost guide.
Why don't WhatsApp clicks, chats and leads match?
| Metric | Where | Why it differs from the next row |
|---|---|---|
| whatsapp_click | GA4 | Includes taps that never send a message, repeat taps, and desktop users without WhatsApp Web set up |
| Conversations started | Inbox / API | Includes chats from ads, saved numbers and existing customers that had no website click |
| New leads created | CRM | Excludes existing contacts, support queries and spam |
| Qualified leads | CRM | Your sales definition, not a tracking artefact |
Worked example (illustrative): a clinic sees 400 whatsapp_click events in a month, 240 chats with a valid website reference code, 300 total new chats (the other 60 from click-to-WhatsApp ads and saved numbers), 210 new leads after removing existing patients and spam, and 70 qualified. Click-to-chat rate = 240 ÷ 400 = 60%. Reporting "400 WhatsApp leads" would overstate leads by about 1.9×. Track each row separately and watch the ratios, not just totals.
WhatsApp tracking QA checklist
| Test | Pass |
|---|---|
| Tap each WhatsApp button on Android and iPhone | One whatsapp_click per tap in DebugView, correct wa_location |
| Prefilled message contains the reference code | Code visible at the end of the text on every button |
| Send the message from a test phone with UTMs on the landing URL | CRM lead shows the same UTMs, landing page and GA4 client ID |
| Edit out the code before sending | Lead created as "website – ref missing", not "direct" |
| Start a chat from a live click-to-WhatsApp ad | Lead has meta_ad_id and ctwa_clid populated |
| Same person messages twice in a week | One contact, no duplicate lead |
| Mark a test lead qualified | One qualify_lead in GA4 and one event in Meta Events Manager; no repeat on re-save |
| Inspect GA4 event parameters | No phone numbers, names or message text |
If you would rather have this built and run for you, our WhatsApp CRM automation service covers inbox, CRM and tracking together.
Sources
- WhatsApp Help Center: How to use click to chat: wa.me link format, number format, prefilled text.
- Tag Manager Help: Click trigger: Just Links trigger and its options.
- Google Analytics Help: Enhanced measurement events: outbound
clickevent and parameters. - Google Analytics Help: Best practices to avoid sending PII: no emails or mobile numbers in GA4.
- Meta for Developers: WhatsApp messages webhook reference: referral object fields and ctwa_clid.
- Meta for Developers: Conversions API for business messaging: payload, supported events, no deduplication.
- Google Analytics: Measurement Protocol, send events: endpoint, client_id, 72-hour backdating.
- Google Analytics Help: Recommended events: lead generation events.