Skip to main content
An iframe is the simplest and most isolated embed method. It works with the default oy.fm URL, an Onlyform subdomain, or a connected custom domain.

Basic iframe

Replace FORM_URL with the exact public URL copied from the Share page:
For example:
Illustration of an Onlyform form embedded inside a webpage

A standard iframe stays within the surrounding page content.

Responsive sizing

Use a container when the form should adapt to the available width:
Use a fixed pixel height when the surrounding page controls scrolling. Use 100vh for a viewport-sized form:
CSS height: auto does not automatically resize a cross-origin iframe to match its document. Use an explicit height unless your site implements its own resize messaging.

Pass hidden fields and UTM values

Append declared hidden fields and enabled UTM parameters to the iframe URL:
URL-encode dynamic values with URLSearchParams instead of concatenating untrusted text:
If your site uses Content Security Policy, allow the selected form hostname in frame-src. See Troubleshooting.