03 — Embedding · Script Tag
One script tag, one form.
The simplest way to put a FormPing form on your site. Drop a single line into your HTML and the widget renders the form you built in the dashboard.
The snippet
<div id="formping-form"></div>
<script src="https://widget.formping.ch/widget.js"
data-token="YOUR_TOKEN_HERE"
data-container="#formping-form"
data-theme="light"
data-lang="en"></script>
Replace YOUR_TOKEN_HERE with the token ID from your dashboard. The widget
renders into the container element you point it at via data-container.
Setting the language
The widget defaults to the language configured on your token, but you can override it
with the data-lang attribute. Supported values:
de, en, fr, es, it,
pt.
<script src="https://widget.formping.ch/widget.js"
data-token="YOUR_TOKEN_HERE"
data-lang="de"
defer></script>
When to use
- You built your form in the FormPing Form Builder.
- You want the widget's styles to inherit nothing from your site (it's scoped).
- You don't need to control the timing of when the form mounts.
When not to use
- You already have an HTML form you want to keep — use Takeover instead.
- You're inside a single-page app and need to mount/unmount on route changes — use Programmatic.
- Your CMS aggressively rewrites or strips inline scripts — use iFrame.
Caching
i
The widget is cached for 5 minutes at the edge with must-revalidate. New form-builder changes propagate within 5 minutes — no hard refresh needed on your visitors' side.
Troubleshooting
- Form doesn't appear — check the browser console. The most common cause is the token's domain allowlist not including your origin.
- Submissions fail with 403 — same: add your domain to the allowlist in the dashboard.
- Form looks unstyled — the widget injects its own CSS. If your site has CSS resets that target
*with high specificity, the widget classes (.fp-input,.fp-btn) may be overridden. Switch to iFrame for full isolation.