<form> element.
After you apply this pattern, your integration starts identity work early and handles every workflow
result safely.
Use the automatic Pixel when your page has a standard HTML form and your code does not control
submission.
Before you begin
Complete the pictured setup guide first. You need:- A form added in Forms, with mapped fields.
- The public key and Pixel form UUID from the form’s Install tab.
- An HTML ID for the form on your page.
- A test page and synthetic visitor data.
Complete example
This standalone example denies analytics and marketing until there is a saved choice. It sets that choice before callinginit(). Have your banner send its current choice and later changes
through DefaultPixelSDK.setConsent() once the SDK is available.
See Consent gating.
When you also install the Pixel, use its complete generated loader and the
saved-choice check before either downloaded script runs.
The SDK applies choices queued on the Pixel loader, so you do not need to wait for the Pixel before
loading it. The script address in this example is a placeholder; use each script address in your
copied snippet.
submitForm() behavior shows a returned scheduler in a modal. A redirect handoff always
navigates the browser. The success message above appears only when neither handoff exists.
Use the correct form identifiers
The 2 identifiers serve different purposes.The form must exist in Default before
submitForm() can match it. Add it with Catalog
forms under Forms → Create new, or, when the form carries data-default-ignore or isn’t a <form>
element, create it under Forms and set its Form ID(s) to the same id. Field names in
Default should match the input name attributes. See
Create a form in Default.Initialize before the visitor uses the form
Initialize the SDK before the visitor uses the form. The complete example callsinit() after
setting initial consent. If you use window.__defaultPixel__.key, the SDK initializes when it loads;
set initial consent through the generated Pixel loader; the SDK applies it when it loads.
Do not create the script or call init() inside the submit handler. Late initialization misses the
email blur, delays identity work, and can delay the scheduler handoff.
If your app supplies the key at runtime, call DefaultPixelSDK.init() once when your page or shared
layout starts. Reuse the initialized SDK across form components. init() returns no promise.
Start pre-enrichment after a valid email
CallrecordFormInteraction() when the visitor leaves a valid email field. This starts identity
and company lookup before submission.
Treat this call as best-effort. Do not block the form if it fails. Avoid sending the same unchanged
email repeatedly.
The SDK waits for this early lookup when a matching submission begins. It uses the saved result
once. It ignores a saved result when its email differs from the submitted email.
Submit once and handle every result
Disable the submit button while the promise is pending. This prevents duplicate requests from quick clicks.submitForm() resolves with success: false for request failures. Check the result instead of
depending on a thrown error.
- Keep the default scheduler modal unless your page needs another display.
- Use
{ target: "#meeting-section" }for an inline scheduler. - Use
falseonly when your code will handleresult.scheduler.url. - Expect redirect handoffs to navigate immediately.
autoDisplaySchedulerdoes not stop them.
Trust scheduler messages only from your scheduler
SetschedulerOrigins to the scheduler origins your page uses. The SDK drops messages from origins
outside that list.
Do not include broad or unrelated origins. Include each exact origin, including the scheme.
Exclude pages and forms from capture
Add this meta tag to disable form capture for a page:data-default-ignore to a form or one of its parent elements to skip only that form:
submitForm() while the Pixel also runs, put
data-default-ignore on the form, its embed container, or a wrapper. Without it, the Pixel
can also capture the same submission, and the workflow can run twice. This includes native HTML
forms and the editor’s Embed this form sample.
Ignored forms do not send automatic email interactions either. Keep the explicit
recordFormInteraction() call from the complete example if you want early enrichment.
The Pixel also skips paths containing /login, /signin, /account, /checkout, /oauth, and
paths under /admin/.
Verify the result
Use the form editor’s Test tab with made-up data, then test the published website. The editor test does not exercise the website’s email blur or submission handler. Confirm these results:- Pre-enrichment starts after email blur.
- The submission returns
success: trueand appears once in Recent Submissions. Success alone does not prove it was saved. - The correct Form Submission workflow runs after it is published.
- The scheduler opens in the selected display mode.
- Failure states leave the visitor with a clear next action.
Troubleshooting
Next steps
Understand the full integration
Learn how identity, form capture, workflows, and scheduler handoffs work together.
Use the API reference
Find every configuration option, method, return value, and scheduler event.