Skip to Content
Welcome to 10ex Docs. Start with the Quickstart, or browse Guides, Concepts, Agents, Developers and Use cases.
DevelopersEmbed a form
How-to

Embed a form

Any form you build in Forms can run on your own site. Build and publish it first (see the Forms guide), then copy a snippet from the form’s Share tab.

The snippets only work once the form is published. Until then the Share tab says “Publish from the header to enable these links and snippets.”

Pick a distribution mode

On the Share tab, Distribute offers three modes:

ModeWhat you getUse it when
Standalone hosted pageA Hosted link like https://app.10ex.ai/f/EMBED_KEY, plus an Embed (iframe) snippetYou want a link to share, or your site only allows iframes
Inline embed (in your site)An Inline scriptThe form should sit inside a page, styled by the form’s own theme
Popup / modalA Popup script plus Popup triggersThe form should open over the page

Inline script

Paste it where the form should appear:

<script async src="https://app.10ex.ai/embed/forms.js" data-form="EMBED_KEY" data-api="https://api.10ex.ai" data-mode="inline"></script>

The form renders right after the script tag. To place it somewhere else, add an empty container with the same key anywhere on the page and the form mounts there instead:

<div data-tnx-form="EMBED_KEY"></div>

The form is styled from its own theme (colors, font, button style, width) and isolated from your page’s CSS, so neither side changes the other.

Same tag with data-mode="popup". When the popup opens depends on its Popup triggers on the Share tab:

TriggerOpens the popup
Button clickAdds a floating button that opens the form
After time on pageAfter the number of milliseconds you enter (5000 = 5 seconds)
After scroll depthWhen the visitor scrolls past the percentage you enter (default 50)
On exit intentWhen the mouse leaves the top of the window (desktop only)

With no triggers, the popup gets the floating button. The popup opens at most once per page view. Click Save after editing triggers.

Iframe

The Embed (iframe) snippet loads the hosted page. Set its height in the field next to the snippet (default 640 px); the width follows the form’s theme.

<iframe src="https://app.10ex.ai/f/EMBED_KEY" width="100%" height="640" style="border:0;max-width:592px" title="Form"></iframe>

Tag submissions with where they came from

If the form has an auto-selected field, the inline and popup snippets include a data-value attribute. Whatever you put there is saved with each submission and shown to the visitor read-only. Use it to tell placements apart, for example one snippet per event session or per landing page:

<script async src="https://app.10ex.ai/embed/forms.js" data-form="EMBED_KEY" data-api="https://api.10ex.ai" data-mode="inline" data-value="Webinar: October launch"></script>

Every submission also records the referring page and any UTM parameters in the page URL. To capture the page URL itself, add a hidden field set to the current page URL in the form builder.

Embed settings

Open Settings from the Publish menu in the form’s header:

  • Allowed domains: comma-separated hosts, for example example.com, www.example.com. Blank allows every site. The match is exact, so list www. and other subdomains separately.
  • Max submissions: blank means unlimited. Once the limit is reached, new submissions are refused.

When something doesn’t show

The script fails quietly on your page, so check the browser console and the network tab:

What you seeWhy
[10ex forms] data-form (embed key) is required in the consoleThe data-form attribute is missing
Nothing renders, the request to /forms/EMBED_KEY returns 404The form isn’t published, or it was archived
403 domain_not_allowedThe page’s domain isn’t in Allowed domains
429 rate_limited on submitToo many submissions from one visitor in a short time
410 submission_limit_reachedMax submissions was reached
Last updated on