Connect Meta Lead Ads to WhatsApp

Updated Nov 28, 20265 min read
English
On this page

Connect a Facebook Page that runs Lead Ads to a WhatsApp inbox in Deskwoot: every form fill on Facebook or Instagram becomes a new conversation with the full form data. Your approved WhatsApp template goes out as soon as Meta delivers the lead and opens the 24 hour reply window.

What you need before connecting

  • A Facebook Page that owns the Lead Ads.
  • A Meta app with the Lead Ads webhook subscribed at the app level.
  • A page token with these permissions: pages_show_list, pages_read_engagement, pages_manage_metadata, leads_retrieval. Get a long lived one (60 days) so you don't have to refresh it every week.
  • The app secret, from Settings > Basic in your Meta app.
  • A WhatsApp inbox with the Cloud API, already set up in Deskwoot.
  • At least one approved WhatsApp message template in Meta Business Manager. It can have placeholders ({{1}}, {{2}}, ...), which you fill in Deskwoot.

Connect the Page

  1. In Deskwoot, go to Settings > Integrations > Meta Lead Ads.
  2. Click Connect a Facebook page.
  3. Paste the Page ID, the long lived Page token and the App secret.
  4. Under Inbox, pick the WhatsApp inbox where conversations should land.
  5. Type the name of your approved welcome template and its language code, for example lead_welcome and en_US.
  6. Click Connect page.

Configure the webhook in your Meta app

  1. Under Connected Facebook pages, click your Page.
  2. Copy the 2 values the panel shows under What do you enter at Meta?
    • Callback URL, like https://deskwoot.com/api/webhooks/meta-leadgen/<your-slug>
    • Verify token, a random string for this Page
  3. Paste both into your Meta App Dashboard under Webhooks, Page, Edit Subscription.

Each connected Page gets its own slug and verify token, so a leak on one Page never authorizes a webhook for another Page.

Fetch the form fields

Deskwoot calls Graph /<page_id>/leadgen_forms?fields=questions and pulls every question key from every active form on this Page, so you can pick them for the placeholders.

  1. In the same panel, under Which fields do your forms have?, click Fetch fields.
  2. Check the question keys that appear below the button.

Field mapping

Where do the answers go? in the Meta Lead Ads settings: each form key, such as email, full_name and phone_number, matched to a contact field

The section Where do the answers go? tells Deskwoot which question of the Meta lead form goes into which contact field. The defaults are sensible:

  • email, EMAIL or whatever your form calls it goes to Email. The email decides who the contact is: Deskwoot finds or creates the contact by email first and falls back to the phone number.
  • full_name goes to Name.
  • phone_number goes to Phone, cut to digits only before Deskwoot stores it as the WhatsApp ID.

If your form also asks for the company or the job title, add a row for each:

  1. Under Where do the answers go?, click Add matching.
  2. In the new row, type the question key into the field Field at Meta, for example email.
  3. In the list of the same row, pick Company or Job title.

Template placeholders

WhatsApp templates use {{1}}, {{2}}, ... placeholders in their text.

  1. Under Placeholders in the template, click Add placeholder until there is one row for each placeholder of your template, in order.
  2. In each row, pick where its placeholder comes from:
    • Lead's first name, taken from the full_name mapping
    • Your account's name, the display name of your Deskwoot account
    • Fixed text, a text you type
    • Form field, any field you fetched above
  3. Click Save to keep the field mapping and the placeholders.

A template without placeholders needs no row: remove the rows with the x next to them.

How a lead arrives

  1. Meta sends a lead webhook to your Page's own URL, signed with HMAC x-hub-signature-256.
  2. Deskwoot checks the signature against your app secret and silently skips the lead if it doesn't match.
  3. Deskwoot fetches the full lead through Graph GET /<leadgen_id>.
  4. Deskwoot finds or creates the contact and fills it from the form, as you mapped the fields.
  5. Deskwoot opens a new conversation in your WhatsApp inbox, with the full form data in customAttributes.metaLeadAd.
  6. Deskwoot sends the welcome template through the WhatsApp Cloud API. It lands on the lead's phone and opens the 24 hour reply window, and your agent (or Fynn, if Fynn is the assignee) takes it from there.

Disconnect a Page

  1. Under Connected Facebook pages, click Disconnect next to the Page.
  2. Confirm with Disconnect.

Deskwoot calls Meta's DELETE /<page_id>/subscribed_apps to stop further webhooks, then deletes the connection here. Even if Meta returns an error (token expired, Page deleted), the connection is still deleted.

Frequently asked questions

Does the lead get a message right away?
Yes. Deskwoot sends your approved welcome template through the WhatsApp Cloud API the moment Meta delivers the lead, which opens the 24 hour reply window.
Which inbox can receive the leads?
A WhatsApp inbox with the Cloud API that is already set up in Deskwoot. You pick it when you connect the Page.
Do I have to subscribe the Page to my app myself?
No. When you connect the Page, Deskwoot checks your page token against Meta's Graph API to confirm the Page exists. Then it calls POST /<page_id>/subscribed_apps?subscribed_fields=leadgen so the Page really starts sending lead webhooks. The subscription of the app alone delivers nothing, so Deskwoot does this for you.
Can one lead create two conversations?
No. Each lead is recorded once per account, in a MetaLeadAdLead row with UNIQUE(accountId, leadgenId). Meta retries a delivery up to 7 times over 5 days, and these repeats never create a second conversation.
How do I see whether leads arrive?
Under Connected Facebook pages, each Page shows the date of its last lead, or No lead yet. If the last lead did not arrive, the Page says Needs attention. Click the Page to see the error under What happened last.

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.