表单
/
4 min read
Embed a hosted inline form
Render a Zalify form directly into a slot on your page — no popup — with the same list capture and lead tracking.
A hosted inline form is a Zalify form that renders directly into a spot on your page — a footer, a sidebar, a landing section — instead of popping up. It uses the same form editor, the same List capture, and the same lead tracking as a popup form. Only the surface is different: it lives in the page.
Inline form vs. popup form
Both are built from the same form in Zalify. What changes is how they appear:
| Popup form | Inline form | |
|---|---|---|
| Where it renders | Floating modal or corner card | Into a page slot you choose |
| Isolation | Shadow DOM (your CSS can't leak in) | No Shadow DOM by default — your page styles the form |
| Loads on | first show_popup trigger | first display_form action |
| Runtime | popup.js | form.js |
The form must be set to inline
Inline and popup are two different "surfaces" of a form. A form compiled for popup (modal/corner) won't render on the inline path — set the form to inline in the Zalify editor so it's built with surface: "form" (display: { mode: "inline" }).
Before you begin
- A form built in Zalify and set to inline.
- A List to subscribe people to (if you're collecting subscribers).
- A stable place on your page to mount it — an element with an
idor class you can target with a CSS selector.
Add a mount point
Put an empty container where you want the form to appear:
<div id="zalify-footer-signup"></div>
Point a display_form action at it
Inline forms are shown by a display_form action, configured in Zalify:
{
"type": "display_form",
"params": {
"form_id": "clniphba00xwkok1qmkyip597",
"selector": "#zalify-footer-signup",
"mode": "replace"
}
}
form_id(required) — the form to render.selector(required) — a CSS selector for your mount point.mode(optional) — how the form is placed:replace(default),append, orprepend.shadow(optional) — settrueonly if you want style isolation. Defaults tofalse.
Works with client-rendered pages
The runtime waits briefly for the selector to appear, so forms mount correctly even into sections your site renders on the client (React, Vue, and other SPA frameworks).
How it loads
On the first display_form action, the Pixel:
- Lazy-loads the form runtime,
form.js, fromhttps://cdn.zalify.com. - Fetches the form document from
https://app.zalify.com/api/v1/forms/<wid>/<form_id>. - Mounts the form's HTML into your selector using the chosen
mode. - Wires it up through the same submission path as popup forms.
Your CSS styles it
Because inline forms skip the Shadow DOM by default, your page's stylesheet applies directly to the form — which is usually what you want, so it matches your theme without extra work. If a page style is interfering and you'd rather isolate the form, set shadow: true in the action.
Capturing leads
This works exactly like a popup form — the two share one submission pipeline:
- Input
nameattributes map to Zalify's fields:email,phone,firstName,lastName,language,emailMarketingConsent,smsMarketingConsent. Any other inputs are dropped, though the full payload is kept on the Submission record. - To subscribe someone, include
subscribe: { list_id, email_marketing_consent }— that adds them to the List and can start an Automation. - On submit, the form fires
form_submitted, POSTs tohttps://reach.zalify.com/v1/public/unisubmit, then firesleadon a successful (2xx) response. - The form's
data-zalify-form-stateattribute cyclesidle → submitting → success | error, so you can style each stage with CSS.
For the full breakdown of the two events and the state machine, see Collect emails with a popup form.
Consent and testing
- Inline forms respect the same consent gate as the rest of the Pixel. With
consentRequired=true, the form won't render or submit until consent is granted — anydisplay_formcalls made beforehand are queued and replayed once it is. See Configure consent. - Preview Mode (
?zalify-preview=true) bypasses the consent gate so you can test. See Test your setup with Preview Mode.
Content Security Policy
If your site enforces a CSP, allow script-src https://cdn.zalify.com so form.js can load.
Next steps
- Collect emails with a popup form — the same capture, as a popup
- Create your first popup — if you'd rather it pop up
- Send conversions to Meta, Google, TikTok & more — forward the
leadevent to your ad platforms