Skip to content

Process7 min read

Getting every lead into a custom CRM: Meta lead forms, website forms and WhatsApp chats in one pipeline

By Published

Short answerGive every source the same lead record, and keep the source's own ID on it. Meta lead ads arrive as a webhook with a lead ID you then fetch, website forms post straight to your API, and WhatsApp chats arrive as message webhooks. Before saving, normalise phone numbers to E.164, lowercase emails, match on WhatsApp user ID, phone and email in that order, and start the response clock from when the lead was created.

What each source actually sends you

A Meta lead ad does not push the lead itself. Meta's leadgen webhook sends a notification with a leadgen_id, the page_id, form_id, ad_id, adgroup_id and a created_time. Your server then requests that lead ID from the Graph API and gets field_data back: a list of name and values pairs such as full_name and email, plus any custom questions under their own field IDs. Meta's Retrieving Leads page says real-time pings can arrive with a delay of up to a few minutes.

Getting there takes setup. Meta's Lead Ads page says your app must pass App Review with the leads_retrieval and pages_manage_ads permissions, and that Business Verification follows approval. An app still in Development mode cannot retrieve leads, except those submitted by people with a role on the app. I would start that review in week one.

A website form is the easy one. You choose the fields, so make them match the lead record from the start.

A WhatsApp chat is not a form at all. The Cloud API messages webhook carries the person's profile name, their wa_id, a user_id and the first message. If they tapped a Click to WhatsApp ad, the message also carries a referral object with the ad's source_url, headline and a ctwa_clid click ID. That is your campaign data for chat leads, so store it.

The lead record, and where each field comes from

One table, one row per enquiry, linked to one contact. Blank cells are fields your team fills in, not fields to invent.

FieldMeta lead formWebsite formWhatsApp chat
Source IDleadgen_idYour form submission IDMessage id (wamid)
Source and campaignform_id, ad_id, adgroup_idPage URL and UTM tags you capturereferral.source_url, headline, ctwa_clid when from an ad
Namefull_name from field_dataName fieldcontacts.profile.name
Phone, stored in E.164Phone field if the form asks for itPhone fieldwa_id or from, when the phone number is available
Email, lowercasedemail from field_dataEmail fieldUsually none; ask in the chat
WhatsApp user IDNoneNonecontacts.user_id (BSUID)
What they wantCustom questions in field_dataYour enquiry fieldsText of the first message
Consent checkboxescustom_disclaimer_responses, fetched separatelyYour own checkbox, stored with the wordingRecord what they agreed to in the chat
Created atcreated_timeSubmission timeMessage timestamp
Owner, status, first response atSet by the CRMSet by the CRMSet by the CRM

Dedupe rules to write down before the first lead arrives

Duplicates are the cost nobody quotes. One person fills in your Instagram form, messages on WhatsApp an hour later, and two salespeople call them. I would agree these rules with the sales lead in writing.

One WhatsApp detail matters more as usernames arrive, which Meta's BSUID page says will roll out gradually in 2026. Meta's messages webhook reference says the user's phone number is omitted when the user has adopted a username and their number is unavailable, and that an integration relying only on phone fields will not be able to process those messages. The BSUID, sent as user_id, is in every messages webhook. Meta's BSUID page adds that it is regenerated if the user changes phone number, which triggers a system webhook. So the CRM has to accept a WhatsApp contact with no phone at all.

  • Normalise every phone to E.164 before saving: a plus sign, the country code, the number, no spaces. A made-up UAE mobile typed as 050 123 4567, 00971 50 123 4567 or +971501234567 is stored once, as +971501234567. Meta's webhook examples show wa_id as digits without the plus, so add it.
  • Store numbers that cannot be parsed as typed, flagged for a person to fix. Do not guess the country.
  • Lowercase and trim emails before comparing. I would not strip dots or plus tags, because that is not safe for every email provider.
  • Match in this order: WhatsApp user ID, then phone, then email. Never merge on name alone.
  • A match attaches the new enquiry to the existing contact. It does not delete anything and keeps both source IDs.
  • If the contact already has an open lead, the new enquiry joins it and notifies its owner instead of creating a second lead. A closed lead gets a fresh one.
  • Key every insert on the source ID, so a webhook delivered twice cannot create two leads.

Assignment and the response clock

I would pick one assignment rule per source and keep it boring. Round robin among the people on shift works for most teams. Language or branch rules come next, if the form or the ad tells you which one applies.

The clock should start at the source's own created time, not when your server received the lead. Meta's created_time and WhatsApp's message timestamp give you that. Stop it at the first human reply or logged call, recorded as first_response_at. An automatic thank-you message does not count. Then set one escalation: a lead with no first response after an agreed number of minutes goes to the team lead. Every response-time report comes from those two timestamps.

What you are allowed to send back on WhatsApp, and what Meta charges for it, is a separate subject. My post on WhatsApp Business pricing and templates covers it.

One safety net: Meta lets you read leads in bulk by form and filter on time_created. A nightly job that pulls the last day's leads and skips known leadgen_ids catches anything a missed webhook dropped. I would also save every lead to your own database as it arrives, rather than treating Meta as the place leads are kept.

A made-up Tuesday: nine enquiries, five people

Everything in this table is invented, including the numbers, to show the rules above working on one day.

TimeSourceWhat arrivedRule appliedResult
09:02Meta formLayla, 050 111 2233, layla@example.comNo matchNew lead, assigned to Omar
09:40WhatsAppLayla, wa_id 971501112233, from an Instagram adPhone matches after adding +Joins Layla's open lead, Omar notified
10:15WebsiteDan, +44 7700 900123, dan@example.comNo matchNew lead, assigned to Sara
10:16WebsiteSame submission againSame source IDIgnored
11:30WhatsAppUsername only, no phone, BSUID AE.88412No match on BSUIDNew lead, assigned to Omar; ask for phone and email
13:05Meta formPriya, phone blank, PRIYA@Example.comNo matchNew lead, assigned to Sara
14:20WebsitePriya, 055 444 5566, priya@example.comEmail matches after lowercasingJoins Priya's open lead
15:50Meta formAhmed, 0501112233Phone matches LaylaHeld for review: same phone, different name
16:45WhatsAppBSUID AE.88412 again, now gives emailBSUID matchesJoins the 11:30 lead

What I build, and what it costs

A custom CRM is custom software, so it is a fixed quote after a written scope, not a package. The scope I would write lists each source, the lead record above, the dedupe rules in plain sentences and the assignment rule per source. Meta's own fees and any messaging provider costs are third-party fees and are not included.

Two case studies are close to this. My Forex CRM is a white-label brokerage CRM covering client onboarding, partner portals, KYC and AML workflow support and role-based access. My AI-Powered Lead Discovery work combines source monitoring, data validation, deduplication, CRM-oriented workflows and permission and suppression controls.

If you need less than a full CRM, such as a staff app where sales see and claim leads with a small dashboard behind it, my Scale package at $2,500 covers up to 50 screens, an admin dashboard, a Node.js backend with PostgreSQL and integrations with the services you use. The Meta and WhatsApp connections would be named in that written scope.

Questions

Do I need Meta's App Review just to pull my own leads?
For a custom integration, yes. Meta's Lead Ads page says the app must pass App Review with the leads_retrieval and pages_manage_ads permissions, then Business Verification. Meta also lists CRM partners that support lead ads, if you would rather not run your own integration.
What if a WhatsApp lead never shares a phone number?
Keep the lead under their business-scoped user ID. Meta says it appears in every messages webhook and can be used to message the user. Ask for a phone or email in the chat if your team needs one, and merge when it arrives.

Sources

Platform rules and fees in this article were checked against these official pages on 16 November 2026. They change, so confirm before you rely on them.

Sannan Malik is a software architect and product builder with 8+ years in software, CEO of Alpha Notic FZE and a Certified Scrum Product Owner. He builds mobile apps and business software for companies in the UAE, the wider Gulf, the UK, the US, Canada and Australia.

Let's build it

Got an idea? Let's talk.

The fastest way to reach me is WhatsApp. Tell me what you're building and I'll reply with how I'd approach it, which package fits, or what a custom scope would look like.

Message me on WhatsApp