See which ad started a WhatsApp chat

Updated Nov 30, 20264 min read
English
On this page

Deskwoot records on its own which Facebook or Instagram ad started a WhatsApp chat. Meta sends the ad's data with the first message, Deskwoot saves it on the conversation and the contact, and you can read it through the API.

What gets saved

When someone clicks a Click to WhatsApp ad and sends their first message, Meta adds a referral object to the incoming webhook. Deskwoot saves all of it on the conversation:

  • Source type: ad or post, depending on whether the click came from a paid ad or a "Send Message" button on a Facebook or Instagram post.
  • Ad or post ID: the Meta object behind the click, useful to group conversations by ad in your reports.
  • Click ID (ctwa_clid): the ID of that single click, which you can match against your Meta Ads reports and send back to the Conversions API.
  • Headline and body: the exact ad text the person saw when they clicked.
  • Source URL: a direct link to the ad or post on Facebook or Instagram.
  • Media type with image or video URL: the creative the person was looking at when they clicked.

Where to find it in Deskwoot

The Came from an ad section in the conversation details: the ad's headline and text, Facebook ad and Open ad

Open a WhatsApp conversation. When it started from a Click to WhatsApp ad, the details on the right show the section Came from an ad: the ad's headline and text, whether it was an ad or a post, where it ran (Instagram or Facebook), and Open ad.

In the chat, a line above the message the person sent from the ad says "Came from the ad" with the ad's headline.

If the same person clicks another ad while their conversation is still open, the new ad replaces the one shown. The previous one stays in conversation.customAttributes.whatsappReferralHistory. The latest ad is also copied to the contact under customAttributes.lastWhatsappReferral, so it stays for later conversations of the same person.

Read it through the API

The data sits 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"
    }
  }
}

Send the data to your CRM or ad platform

On the Business plan and up, Deskwoot's outgoing webhooks (Settings > Webhooks) include the ad data. The event Conversation created carries the conversation, with the ad data under customAttributes.whatsappReferral. Events such as Conversation updated or Conversation resolved carry the conversation ID but not the ad data. For those, read the ad data through the API:

  1. Take the conversation ID from the webhook event.
  2. Read the conversation through the API as shown above.
  3. Pass customAttributes.whatsappReferral (click ID and ad ID) on to HubSpot, Pipedrive, Notion, Google Sheets, or back to Meta's Conversions API, so Meta can optimize your ads on real results.

Limits to know about

  • Meta adds the referral object only to the very first message of a chat that started from an ad. Deskwoot saves it from that message. Later messages in the same conversation do not carry it.
  • Conversations that did not start from an ad (organic chats, your own messages, link clicks without an ad) show no ad section. That is correct, since there is nothing to attribute.

Frequently asked questions

Which plan do I need?
The ad section in the conversation's details is part of the Business plan and up. Reading the data through the API needs the Enterprise plan.
Does it work with WhatsApp through Twilio?
No. It needs the WhatsApp Cloud API channel, because WhatsApp through Twilio does not send the same data.
Where do I see which ad started a WhatsApp conversation?
Open the conversation. When it started from a Click to WhatsApp ad, the details on the right show the section Came from an ad.
Do outgoing webhooks include the ad data?
Yes, on the Business plan and up. The event Conversation created carries the conversation, with the ad data under customAttributes.whatsappReferral. Events such as Conversation updated carry the conversation ID but not the ad data. Use the ID to read the conversation through the API.

Was this guide helpful?

Keep reading

Still need help?

Fynn answers from these guides in the chat, and you can reach the team there too.