Events
The form emits ordinary CustomEvents that bubble, so every framework can
bind them natively and no wrapper package is required.
| Event | When | detail |
|---|---|---|
fb:ready |
The form has rendered | { form } |
fb:step |
The visitor moved between steps | { index, total, direction } |
fb:submit |
A submission is being sent | { data } |
fb:success |
It was accepted | { submission } |
fb:redirect |
The form is about to navigate | { url } |
fb:close |
An overlay was dismissed | none |
document.addEventListener('fb:success', (event) => { // e.g. a conversion event window.dataLayer?.push({ event: 'form_submitted' });});Because they bubble, a listener on document catches every form on the
page. Listen on a wrapper element instead when you have several and need
to tell them apart.
Inside an iframe
Section titled “Inside an iframe”In iframe mode the events cross a frame boundary as postMessage, and the
loader re-emits them on your container. The parent only accepts a message
when the source window, the origin and the instance id all match:
checking the origin alone is not enough, because any frame from the same
origin could otherwise impersonate it.