Track WhatsApp Leads from Meta Ads

Can I track if a contact came from a Meta (Facebook/Instagram) ad campaign?

When a user clicks on a Click-to-WhatsApp ad in Facebook or Instagram and sends you a message, our API delivers a webhook containing all relevant information.

The incoming message webhook will include a context.ad object with details about the campaign:

  • ad title and body

  • media type and URLs

  • AD ID and source link

  • conversion token (if enabled)

This allows you to:

  • Track the ad campaign each contact came from

  • Attribute leads correctly

  • Personalize replies based on the ad content

  • Assign and route new leads in your CRM

You can find the context.ad and context.conversion fields inside the webhook payload when the contact reaches you through a Meta ad.

Note: This attribution data is only available when the ad click results in a message and attribution is enabled in your WhatsApp Business settings.


Example webhook snippet:

{
  "messages": [
    {
      "id": "TEST_MSG_ID_12345",
      "from_me": false,
      "type": "text",
      "chat_id": "[email protected]",
      "timestamp": 1754275820,
      "source": "mobile",
      "text": {
        "body": "Hi, I'm interested in the double-storey terrace house. Can you share more info?"
      },
      "context": {
        "conversion": {
          "data": "TEST_CONVERSION_TOKEN_ABC123XYZ456",
          "source": "FB_Ads"
        },
        "ad": {
          "title": "Test Ad Campaign - Property Promo",
          "body": "🏠 Brand New Homes\n📍 Prime Location\n✅ Freehold Title\nContact us now",
          "media_type": "image",
          "preview_url": "https://example.com/media/preview.jpg",
          "media_url": "https://facebook.com/ads/testvideo123",
          "source": {
            "id": "TEST_AD_ID_987654321",
            "type": "ad",
            "url": "https://fb.me/testadlink123"
          },
          "attrib": true,
          "ctwa": "TEST_CTWA_TOKEN_1234567890"
        }
      },
      "from": "60000000000",
      "from_name": "Test User"
    }
  ],
  "event": {
    "type": "messages",
    "event": "post"
  },
  "channel_id": "MANTIS-M72HC"
}

Last updated

Was this helpful?