Track which Facebook or Instagram ad drove a WhatsApp chat
On this page
Tracking which Facebook or Instagram ad drove a WhatsApp chat is automatic in Deskwoot: every Click-to-WhatsApp ad sends Meta's referral data to your inbox with the first message, and Deskwoot saves the full ad context on the conversation, on the contact, and through the API.
What gets captured
Every time a visitor clicks a Click-to-WhatsApp ad and sends their first message, Meta attaches a referral object to the inbound webhook. We save the whole thing on the conversation:
- Source type. Either
adorpost, depending on whether the click came from a paid ad or a "Send Message" CTA on a Facebook/Instagram post. - Ad or post ID. The Meta object that drove the click, useful for grouping conversations by ad in your reports.
- Click ID (
ctwa_clid). The per-click identifier you can match against your Meta Ads reporting and feed back into the Conversions API. - Headline and body. The exact ad copy the visitor saw at the moment of the click.
- Source URL. A direct link back to the ad or post on Facebook.
- Media type plus image or video URL. The creative the visitor was looking at when they clicked.
Where to find it in Deskwoot
Open any WhatsApp conversation. The right-hand information panel shows a green Came from WhatsApp ad card whenever the conversation started from a Click-to-WhatsApp ad. If the same person clicks another ad while their conversation is still open, the new attribution replaces the visible card and the previous one is preserved on conversation.customAttributes.whatsappReferralHistory.
The latest referral is also mirrored onto the contact under customAttributes.lastWhatsappReferral, so the attribution sticks around for any future conversation from the same person.
Pulling it via API
The data is exposed on the standard conversation and contact endpoints under customAttributes. Reading it through the API needs an API token, which only the Enterprise plan can create:
GET /api/v1/conversations/<id>
{
"id": "...",
"customAttributes": {
"whatsappReferral": {
"sourceUrl": "https://fb.me/2abc123def",
"sourceId": "120203456789012345",
"sourceType": "ad",
"headline": "Patch Video Ad",
"body": "Get our new patch with 30% off this week",
"ctwaClid": "AAabcdEFGHijklMNOPqrstUVWxyz1234567890",
"capturedAt": "2026-05-01T19:39:41Z"
}
}
}
Sending the data into your CRM or ad platform
Deskwoot's outgoing webhooks (Settings > Webhooks) do not include the ad data. Events such as Conversation updated or Conversation resolved carry the conversation ID. Use that ID to read the conversation through the API as shown above, then pipe customAttributes.whatsappReferral (click ID and ad ID) into HubSpot, Pipedrive, Notion, Google Sheets, or back into Meta's Conversions API for closed-loop optimization.
Limits to know about
- Meta only attaches the
referralobject to the very first message of an ad-originated session. We grab it on the first message and persist it. Later messages in the same conversation do not carry it. - Conversations that did not start from an ad (organic chats, manual replies, link-clicks not tied to an ad) will not show the card. That is correct behavior, since there is nothing to attribute.
- The feature requires the WhatsApp Cloud API channel. WhatsApp via Twilio does not expose the same payload.
- The ad card in the conversation's details is part of the Business plan and up. Reading the data through the API needs the Enterprise plan.
Frequently asked questions
Where do I see which ad started a WhatsApp conversation?
What does Deskwoot save from the ad?
ctwa_clid), the ad's headline and body, the source URL, and the media type with the image or video URL.Which plan do I need?
Does it work with WhatsApp through Twilio?
Do outgoing webhooks include the ad data?
customAttributes.whatsappReferral.Was this guide helpful?
Keep reading
- Connecting your email inboxConnect any email address to Deskwoot and answer email next to your other channels: forwarding on every plan, or IMAP/SMTP from the Startup plan.Read guide
- Setting up WhatsApp BusinessConnect your WhatsApp Business account to Deskwoot to manage WhatsApp conversations alongside your other channels. Deskwoot uses the WhatsApp Cloud API, which iRead guide
- Telegram bot integrationConnect a Telegram bot to Deskwoot and answer private chats and Telegram groups from your inbox, with member names, replies to single messages and a contact for every member.Read guide
Ask Fynn about this guide
Get a short answer from this guide and the rest of the help center.