QualimizeQualimize
FeaturesHow it worksQualified leadsMeta CAPIComparePricingResourcesContact
LoginBook 1:1 Demo
QualimizeQualimize

The CRM for teams running Meta Ads. Capture every lead, record what your sales team finds, and send those outcomes back to Meta.

+91 94997 11011WhatsApp us

Address

Sama Savli Road, Vadodara,
Gujarat, 390008

Product

  • Features
  • Pricing
  • Product tour
  • How it works
  • Qualified leads
  • Meta CAPI
  • For agencies
  • Partner program

Industries

  • All industries
  • Real estate CRM
  • Travel CRM
  • Education CRM
  • Visa consultancy CRM
  • Healthcare CRM
  • Solar CRM
  • Marketing agencies

Compare

  • All comparisons
  • vs Zoho CRM
  • vs LeadSquared
  • vs TeleCRM
  • vs Privyr
  • vs GoHighLevel
  • vs HubSpot
  • vs Salesgem
  • vs FlowZo
  • LeadSquared alternatives
  • GoHighLevel alternatives
  • Privyr alternatives

Company

  • About
  • Contact
  • What's new
  • Pricing
  • Login

Legal

  • Security & data
  • Privacy policy
  • Terms of service
QualimizeQualimize

The CRM for teams running Meta Ads. Capture every lead, record what your sales team finds, and send those outcomes back to Meta.

+91 94997 11011WhatsApp us

Address

Sama Savli Road, Vadodara,
Gujarat, 390008

Product

  • Features
  • Pricing
  • Product tour
  • How it works
  • Qualified leads
  • Meta CAPI
  • For agencies
  • Partner program

Industries

  • All industries
  • Real estate CRM
  • Travel CRM
  • Education CRM
  • Visa consultancy CRM
  • Healthcare CRM
  • Solar CRM
  • Marketing agencies

Compare

  • All comparisons
  • vs Zoho CRM
  • vs LeadSquared
  • vs TeleCRM
  • vs Privyr
  • vs GoHighLevel
  • vs HubSpot
  • vs Salesgem
  • vs FlowZo
  • LeadSquared alternatives
  • GoHighLevel alternatives
  • Privyr alternatives

Company

  • About
  • Contact
  • What's new
  • Pricing
  • Login

Legal

  • Security & data
  • Privacy policy
  • Terms of service

© 2026 Qualimize. All rights reserved.

Better signals in. Better customers out.

Back to blog
Integrations

How to Send Website Form Leads to Your CRM with a Webhook

A step-by-step guide to posting website form leads straight into your CRM with a webhook: the JSON payload, the auth header, capturing UTM, fbclid and ad IDs, browser vs server calls, error codes and a testing checklist.

Written by Qualimize Team

Founder, Qualimize

Published
November 16, 2026
Last updated
November 16, 2026
Reading time
11 min read
INTEGRATIONSPOST /webhooks/leadLIVELead createdContact page201 · ad_id savedLead createdPricing form201 · UTM onlyLead createdHome pageSame phone flaggedRejectedOld landing401 · token revokedRejectedTest form422 · no contact

Table of contents

  1. 01 The short answer
  2. 02 What a lead webhook actually is
  3. 03 The payload: what to send
  4. 04 Capturing UTM, fbclid and ad IDs on the page
  5. 05 Browser call or server-side call?
  6. 06 Responses, errors and retries
  7. 07 A testing checklist before you go live

Full article

The short answer

To send website form leads to your CRM with a webhook, make your form POST a JSON body (name, phone, email, plus any tracking fields) to the CRM's webhook URL with a secret token in the Authorization header. The CRM checks the token, creates the lead, assigns it and replies with a success code. Everything else in this guide is about doing that reliably: capturing the right tracking data, keeping the token safe, and handling the errors.

A webhook replaces the two habits most small businesses start with: a form that emails the owner, and a form that writes to a Google Sheet someone checks twice a day. Both work until the day nobody opens the inbox, or two reps call the same person. A webhook puts the lead in the same queue as your Meta Instant Form leads, with the same assignment rules and follow-up reminders.

If your website traffic comes from Meta ads, the webhook is also where ad attribution is won or lost. A lead that arrives without the campaign, ad set and ad it came from can never be counted in cost per qualified lead by ad, and cannot be matched well when you send its outcome back to Meta.

What a lead webhook actually is

A webhook is just a URL that accepts an HTTP POST. Your form, or your website's server, sends the lead's details to that URL the moment the visitor clicks Submit. There is no polling, no CSV and no copy-paste: one request, one lead.

Three pieces have to line up. The URL tells the request where to go. The token, sent in an Authorization header as 'Bearer' followed by the secret, tells the CRM which workspace the lead belongs to and proves the request is allowed. The JSON body carries the lead itself. If any of the three is wrong, the CRM should refuse the request with a clear error code rather than silently dropping it.

Many form builders and website plugins have a 'webhook' or 'send to URL' option, sometimes only on paid tiers. If yours does, you may not need a developer at all. If your site is custom-built, the whole integration is usually 20 to 40 lines of code in the form's submit handler.

  • URL: the CRM's webhook endpoint, always HTTPS
  • Header: Authorization: Bearer <your token>, plus Content-Type: application/json
  • Body: the lead's contact details, tracking fields and any extra form answers
  • Response: a success code with the new lead's ID, or an error code that says what went wrong

The payload: what to send

Send the fields the CRM needs to create and route the lead, then the fields that explain where the lead came from, then anything else the form asked. As a concrete example, here is how Qualimize's lead webhook (POST /api/webhooks/lead) is laid out; most CRM webhooks follow a similar shape, so check your own CRM's documentation for exact field names.

Core fields: name, phone, email and source (a short label for which form it was, such as 'home-page' or 'pricing-form'). At least one of name, phone or email must be present or the lead is rejected. Everything else is optional and never blocks the lead from being created.

Attribution fields: utm_source, utm_medium, utm_campaign, utm_term, utm_content, fbclid, fbc, fbp, gclid, landing_page and referrer. Ad identity fields: campaign_id, adset_id, ad_id, campaign_name, adset_name, ad_name, placement and site_source_name. Extra questions go in an answers object of flat text values, for example { "budget": "40-60 lakh", "locality": "Baner" }; up to 30 keys are kept and each value is capped at 1,000 characters.

Example request body for a Pune property enquiry: { "name": "Rohit Kulkarni", "phone": "+919800000000", "email": "rohit@example.com", "source": "2bhk-landing", "utm_source": "facebook", "ad_id": "120210000000000000", "answers": { "budget": "60-80 lakh" } }. The name, number and IDs are made up for illustration.

Capturing UTM, fbclid and ad IDs on the page

The webhook can only store what the page sends, and the page only knows what was in the landing URL and the browser's cookies. So before you write the submit handler, decide where each tracking field comes from.

UTM parameters and fbclid come from the landing page URL. Meta adds fbclid to the link when someone clicks an ad. The _fbp cookie is set by the Meta Pixel on your domain, and _fbc holds the click ID; Meta's documentation says that when fbclid is in the URL but there is no _fbc cookie, you can build the fbc value yourself in the format fb.1.<creation time in milliseconds>.<fbclid>, keeping the fbclid exactly as received.

Neither fbclid nor UTMs tell you which ad the person clicked. fbclid is opaque, and UTMs are free text someone typed. To get the real ad, paste dynamic URL parameters into Ads Manager (Ad, then Tracking, then URL parameters), for example ad_id={{ad.id}}&adset_id={{adset.id}}&campaign_id={{campaign.id}}. Meta replaces each {{...}} macro with the real value when it serves the ad, and your form reads them from the URL like any other parameter.

Two traps catch most teams. First, visitors rarely submit on the page they land on; store the parameters in a first-party cookie or session storage on arrival so a form three clicks later still sends them. Second, if the link is opened outside a paid ad (a shared link, an ad preview, an organic post), the macros arrive unexpanded as literal text like {{ad.id}}. Drop any value that still contains double curly braces; storing it creates a fake ad in every report.

Browser call or server-side call?

You can call the webhook straight from the visitor's browser with fetch(), or have your own server receive the form and forward it. Both are valid; they trade convenience for control.

A browser call is the quickest to build and automatically carries the visitor's real IP address and user agent, which help Meta match the person if the lead's outcome is later sent through the Conversions API. The cost is that the token sits in your page's JavaScript, where anyone can read it. Treat a browser token as write-only and low-value: it can create leads in your CRM but should not be able to read anything. Use one token per site, and revoke and replace it if spam starts arriving.

A server-side call keeps the token secret and lets you add your own spam checks, such as a captcha or rate limit, before forwarding. The catch is that the CRM now sees your server's IP and user agent instead of the visitor's. Forward the visitor's values explicitly (in Qualimize's webhook these are client_ip_address and client_user_agent), otherwise every lead records the same server address, which no ad platform can match to a person.

Responses, errors and retries

A good webhook answers every request with a status code and a short machine-readable reason. Your form should read it, show the visitor a friendly message, and log the failure somewhere you will see it. A form that shows 'Thank you' no matter what the CRM replied is how leads disappear without anyone noticing.

Retry only the errors that can succeed on a second try. A 503 means a temporary problem on the CRM side and is safe to retry after a few seconds. A 401, 400 or 422 will fail the same way every time until you fix the token or the payload, so retrying just hides the problem. Keep any request ID the CRM returns in a response header (X-Request-Id in the example webhook); it lets support find the exact request in their logs.

Retries and impatient visitors who click Submit twice can create the same person twice. Pick a CRM that flags possible duplicates by phone and email rather than one that either blocks them silently or lets them through unmarked, so your team sees the repeat and decides.

A testing checklist before you go live

Test with real requests, not just a form that looks right. Ten minutes here saves a month of lost website leads.

Run the checks in order, with a test lead name you will recognise and delete afterwards. In Qualimize, the website webhook settings show recent website leads and include a panel to send a test lead with a pasted token, which confirms the endpoint and token work before you touch your site.

  • Send a request with no token: expect 401, and no lead created
  • Send a valid request with only a phone number: expect success and a lead in the CRM
  • Open your landing page with ?utm_source=test&fbclid=abc123&ad_id=999 in the URL, submit the form, and check that all three values appear on the lead
  • Open the page with a literal ad_id={{ad.id}} and confirm the lead does not show {{ad.id}} as its ad
  • Navigate to a second page before submitting and confirm the tracking values survived
  • Submit the same phone twice and confirm the second lead is flagged as a possible duplicate
  • Confirm the lead was auto-assigned and the rep got a notification

Comparison tables

Calling the webhook from the browser vs from your server

FactorBrowser call (fetch from the page)Server-side call
Build effortLowest: a few lines in the submit handlerHigher: needs your own backend route
Token exposureVisible in page source; use a write-only, revocable tokenStays secret on your server
Visitor IP and user agentSent automatically with the requestMust be forwarded explicitly in the body
Spam controlRelies on the form builder or CRMYou can add captcha, rate limits and checks first
Cookie access (_fbp, _fbc)Read directly in JavaScriptMust be passed from the browser to your server
Best forStatic sites, landing pages, quick launchesCustom sites with a backend, high-spam forms

Example webhook responses and what to do about each

StatusMeaning (example webhook)Retry?What to fix
201Lead created; body returns the lead IDNoNothing
400Body was not valid JSONNoSend JSON with Content-Type: application/json
401Token missing, wrong or revokedNoCheck the Authorization: Bearer header and the token
403Workspace is not activeNoCheck the CRM account status
405Used GET instead of POSTNoSend a POST request
422None of name, email or phone was sentNoCheck the form's field names
503Temporary database error on the CRM sideYes, after a short waitNothing on your side; retry

FAQ

How do I connect my website contact form to my CRM?

Get the CRM's webhook URL and an API token, then make the form send a POST request with a JSON body (name, phone, email and tracking fields) to that URL, with the token in an Authorization: Bearer header. Many form builders have a webhook option; on a custom site it is a short fetch() call in the submit handler. Test with a real submission before going live.

How do I track which Facebook ad a website lead came from?

Add dynamic URL parameters such as ad_id={{ad.id}}, adset_id={{adset.id}} and campaign_id={{campaign.id}} in Ads Manager under the ad's Tracking section. Meta fills them in when it serves the ad. Your landing page reads them from the URL, keeps them in a cookie until the form is submitted, and sends them to the CRM with the lead. UTMs and fbclid alone cannot identify the ad.

Is it safe to put a CRM API token in website JavaScript?

Only if the token is write-only and limited to creating leads, because anyone can read it in the page source. The worst case is then spam leads, not data theft. Use a separate token per site and revoke it if abused. If the token can read or change data, call the CRM from your own server instead.

What is fbc and fbp, and should I send them with my form leads?

_fbp is a browser ID cookie set by the Meta Pixel, and _fbc holds the ad click ID built from fbclid. Meta recommends sending both with Conversions API events when available because they improve matching. Read them from the cookies when the form is submitted and include them in the webhook body; if only fbclid is present, Meta's documentation explains how to build fbc from it.

Why are my website leads showing {{ad.id}} instead of a real ad ID?

Meta only replaces dynamic macros when it serves a paid ad. If the tracking link was opened from an ad preview, an organic post, a bio link or a shared URL, the literal text arrives instead. Have your form or CRM ignore any value that still contains double curly braces, so those leads are treated as untracked instead of being credited to a fake ad.

Where does Qualimize fit?

Qualimize gives each workspace a lead webhook with per-site tokens, so website form leads land in the same pipeline as Meta Instant Form leads, with UTMs, fbclid and ad IDs captured, unexpanded {{...}} macros dropped, duplicates flagged and auto-assignment applied. That matters if you run Meta ads to a website and want cost per qualified lead by ad. If your forms only go to email and you get a handful of leads a month, a webhook of any kind may be more than you need.

Key takeaways

  • A lead webhook is one POST request: URL, a Bearer token in the Authorization header, and a JSON body with the lead.
  • Require only one contact field and make every tracking field optional, so a missing UTM never blocks a lead.
  • UTMs and fbclid do not identify an ad; dynamic URL parameters like ad_id={{ad.id}} in Ads Manager do.
  • Store tracking values on arrival, drop unexpanded {{...}} macros, and forward the visitor's IP and user agent on server-side calls.
  • Retry only temporary errors such as 503, show real errors to yourself, and test seven cases before going live.

Further reading

  • Meta: fbp and fbc parameters (Conversions API)
  • Meta Business Help Center: specifications for URL dynamic parameters
  • MDN: Using the Fetch API

Keep reading

  • ProductHow Qualimize sends lead stages to Meta (CAPI)
  • GuideServer-Side Tracking Explained
  • GuideEvent Match Quality (EMQ): Complete Guide
  • GuidePixel vs Conversions API: Which One Matters More?
  • ProductPricing: one plan, every feature
  • CompareCompare CRMs for Meta lead ads
Discuss Qualimize

Keep reading

Related articles

Integrations

How to Get IndiaMART Leads into Your CRM

Qualimize is a CRM built for Meta lead ads, with IndiaMART lead sync available on request per workspace. It suits businesses that get leads from both Meta ads and IndiaMART and want them in one pipeline with auto-assignment by source and reporting by source. If IndiaMART is your only channel and you need GST or buyer trust details in the CRM, those stay in IndiaMART's Lead Manager whichever CRM you use.

Read next
Meta CAPI & Tracking

How to Send CRM Lead Stages to Meta, Step by Step

Qualimize is a CRM for Meta lead ads that has this built in. A status in your workspace can be attached to Contact, Lead, SubmitApplication or Purchase, and the event is sent server-side when a rep changes the status, with the Meta lead ID, hashed contact details and a stable event ID. Failed sends retry automatically and every send is visible in Settings. If you already use a CRM you like, the steps in this guide work with any tool that can call the Conversions API.

Read next
Meta CAPI & Tracking

Which Meta Events to Send for Lead Gen: Contact, Lead, SubmitApplication, Purchase

Qualimize uses exactly this ladder. Each workspace status can be attached to one of four signals: Contact, Lead, SubmitApplication or Purchase, with defaults of Contacted, Pre-Qualified, Qualified and Converted. Purchase carries the deal value and currency when a rep records it. If you need a different event, such as Schedule, you would need another tool or a custom integration.

Read next

Build a cleaner Meta Ads sales workflow

Qualimize helps you capture leads, qualify them faster, and connect CRM outcomes back to ad performance.

Book 1:1 Demo
20-minute walkthroughMeta CAPI built-inNo lock-in
See Plans & Pricing