<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:- An approved form 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
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 two identifiers serve different purposes.Initialize before the visitor uses the form
Setwindow.__defaultPixel__ before sdk.js loads. The SDK initializes when the script 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 that initialization promise across form components.
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:
/login, /signin, /account, /checkout, /oauth, and
paths under /admin/.
Verify the result
Use the form editor’s Test tab with synthetic data. Confirm these results:- Pre-enrichment starts after email blur.
- The submission returns
success: true. - 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.