Connecting a landing page or form to a campaign
Your page posts JSON straight to the campaign's endpoint — no backend, no form service, no API key. The two things that decide whether the lead is usable are the exact field names and the consent flag.
Who this is for
Whoever builds or owns the landing page. Usually an admin or a marketer, not a producer.
Before you begin
- A campaign to attach the leads to — the endpoint is per-campaign, and it's what tags the product.
- Control of the page's HTML or a code/embed block.
You don't need a backend
The endpoint accepts a plain JSON POST directly from the browser and is CORS-enabled. There's no API key and no auth header.
This matters because AI page builders will cheerfully invent an API route, a database and a form service if you don't tell them not to — and then the lead lands somewhere you can't see. The connector gives you a brief that says explicitly not to build any of that.
The URL itself is the credential. Keep it out of a public git repo, but it's safe in client-side JavaScript.
Field names are the whole game
The campaign expects specific names. `first_name` and `phone` are required; `last_name`, `email`, `state` and `zip` are optional but worth collecting.
Two that catch people: send `zip` as a STRING so leading zeros survive, and send `phone` in any format you like — digits get normalised on our side.
A page that posts `fullName` instead of `first_name` produces a lead that technically arrived and can't be worked properly. Use the connector's field list rather than guessing.
The consent checkbox
Send the checkbox value as a boolean field named `sms_consent`. This is the field that decides whether the lead can legally be texted, so it has to reflect what the person actually ticked.
One trap worth knowing: don't set consent from a URL parameter. A `?sms_consent=true` in the link would overwrite an unticked box and turn a shared link into a consent-granting device, which defeats the entire point of asking.
Test before you spend
Submit the form once for real and check the lead arrives with the fields mapped where you expect and the consent flag set correctly. That single submission is worth more than any amount of reading the code — and it's much cheaper to find a broken field name before you point ad spend at the page.
How to check it worked
- Submit your own form and confirm a lead appears on the right campaign with the right product.
- Check first name, phone, state and the consent flag specifically — those are the four that change what happens next.
- Tick and un-tick the consent box on two submissions and confirm the flag differs.
Common mistakes
- Letting an AI builder create a backend or form service instead of posting directly.
- Posting fullName rather than first_name — the lead arrives, but not usably.
- Sending zip as a number, which eats leading zeros.
- Driving consent from a URL parameter instead of the actual checkbox.
Related
Where this lives in the app
This is documentation for Virtual Closer. Book a walkthrough or sign in.