Browse and search developers
Embed SDK
Install the embed snippet
Create an embed in Share, copy the two-line snippet, and paste the container div and embed.js script tag into your page or site builder.
On this page
Installing an embed takes two lines of HTML: a container element that carries the embed id, and the script tag that loads embed.js. The app generates both for you.
Create an embed and copy the code
- Publish the form. Embeds only load for published forms.
- In the form builder, open the
Sharetab and chooseEmbed in a web page. - Click
New embed, or select an existing embed from the list. - On the
Designtab, pick anEmbed modeand adjust its settings. TheAdvancedtab holds URL parameter settings. - Optionally rename the embed, then click
Apply changesto save. - Click
Get the code. The "Embed your form" dialog shows the snippet and steps for WordPress, Squarespace, Webflow, Shopify or "Other embeds". Copy the snippet.
The snippet
<div data-formit-embed="YOUR_EMBED_ID"></div>
<script src="https://embed.formitai.com/embed.js?v=7"></script>YOUR_EMBED_ID stands for the embed id the dialog fills in. The ?v=7 value is the current script version, so always copy it from the dialog instead of typing it.
| Part | What it does |
|---|---|
<div data-formit-embed="..."> | Marks where the embed mounts. For Standard the iframe renders inside this element. Popup and slider modes render their launcher button here. Full page, popover and side tab attach fixed-position elements to the viewport, so the div’s position on the page matters less. |
<script src=".../embed.js?v=7"> | Loads the SDK. On load it mounts every [data-formit-embed] element already in the page. |
Placement rules
- Put the div where you want the form, and load the script once per page. The script mounts all embed divs on the page, so several embeds can share one script tag.
- If the script runs while the page is still loading, it waits for
DOMContentLoadedand then mounts every embed div in the HTML. If it runs later (for example, injected by a tag manager), it mounts the divs that exist at that moment. - Elements added later, for example by a single-page app, are not picked up automatically. Call
FormitEmbed.init()after adding them. See the frameworks guide. - Each element mounts once. The SDK marks mounted elements with
data-formit-mounted, and scanning again skips them.
Site builders
The dialog’s platform steps boil down to pasting the snippet into a raw HTML element. In WordPress use a Custom HTML block, in Squarespace a Code block, in Webflow an Embed element, and in Shopify a theme template or custom liquid section.
Check the install
- Open the page and confirm the form or launcher appears. "Unable to load form embed." means the configuration request failed. Check that the form is published and the embed id is correct.
- In the browser console,
[FormitEmbed]messages show the underlying error. - After changing embed settings, reload the page. You do not need to re-copy the snippet unless the dialog shows a newer
?v=value.
Related
Can't find what you need?