Embedding a form on your website
Add your form to WordPress, Wix, Squarespace, Webflow, Shopify, a plain HTML page or a React site, and limit which websites are allowed to embed it.
An embedded form sits inside a page of your own website, so customers can ask for a price without leaving it. You paste a short snippet once. After that, every time you publish, the form on your website updates by itself.
The embed snippet
Open the form, go to the Share tab and copy the embed snippet. It looks like this, with your own business and form in place of the examples:
<div data-formradius-form="your-business/your-form"></div>
<script async src="https://formradius.com/embed.js"></script>
Paste it into your page where you want the form to appear. Both lines are needed: the first marks the place, and the second loads the form into it.
The form resizes automatically. It grows and shrinks to fit its contents, so there is no scroll bar inside your page as a customer moves between steps.
The iframe fallback
Some website builders remove scripts from pasted code. If the form does not appear, use the iframe version from the Share tab instead:
<iframe src="https://formradius.com/embed/your-business/your-form" title="Booking form" loading="lazy" style="width:100%;height:900px;border:0"></iframe>
An iframe on its own cannot resize itself. If the form is cut off or leaves a gap, change the height value to suit your form. 900px suits most forms.
Steps for your platform
WordPress
- Edit the page or post where you want the form.
- Add a Custom HTML block.
- Paste the embed snippet into the block.
- Preview the page, then update or publish it.
In a page builder plugin, use its HTML or code element in the same way.
Wix
- Open the page in the Wix editor.
- Add an Embed HTML element from the embed options.
- Choose to enter code, and paste the embed snippet.
- Resize the element to the width and height you want, then publish your site.
Wix places embedded code in its own frame of a fixed size. If the form is cut off, make the element taller, or use the iframe version.
Squarespace
- Edit the page and add a Code block where you want the form.
- Make sure the block is set to HTML, and paste the embed snippet.
- Save and view the page.
Code blocks that run scripts need a Squarespace plan that allows them. If your plan does not, link to your hosted form with a button instead.
Webflow
- Open the page in the Designer.
- Drag an Embed element to where you want the form.
- Paste the embed snippet and save.
- Publish the site. Custom code only runs on the published site, not inside the Designer.
Shopify
- In the theme editor, open the page or template where you want the form.
- Add a Custom Liquid or custom HTML section or block, where your theme allows one.
- Paste the embed snippet and save.
If your theme has no such section, link to your hosted form from a button or menu item instead.
Plain HTML
Paste the embed snippet into the page's HTML, inside the <body>, where the form should appear:
<main>
<h1>Get a quote</h1>
<div data-formradius-form="your-business/your-form"></div>
<script async src="https://formradius.com/embed.js"></script>
</main>
React and Next.js
Render the placeholder and load the script after it is on the page:
import { useEffect } from "react";
export function BookingForm() {
useEffect(() => {
const script = document.createElement("script");
script.src = "https://formradius.com/embed.js";
script.async = true;
document.body.appendChild(script);
return () => script.remove();
}, []);
return <div data-formradius-form="your-business/your-form" />;
}
In Next.js, put this in a client component (a file that starts with "use client"). If you would rather not load a script, render the iframe version instead. It works in any framework.
Anything else
Most website builders have a block called HTML, Embed or Code. Paste the embed snippet there. If the builder removes scripts, use the iframe version. If it accepts neither, add a button that links to your hosted form.
Limiting which websites can embed your form
By default, a published form can be embedded on any website. To restrict it, list your websites under Allowed websites on the form's Settings tab.
- Enter the domain only, such as
example.co.uk. You do not needhttps://orwww. - Each domain you list also allows its subdomains. Listing
example.co.ukallowswww.example.co.ukandshop.example.co.uk. - Once the list has at least one entry, only the listed websites and their subdomains can show the form. Browsers refuse to display it anywhere else.
- Listed websites must be served over HTTPS.
- Leave the list empty to allow any website.
The hosted link always works, whatever is on the list. Restrictions apply to embedding only.
Remember to add every address your site uses. If your website is reachable at both example.co.uk and example.com, list both.
Privacy on your website
An embedded form sets no cookies and does no advertising or cross-site tracking. You remain responsible for your own website's privacy notice, which should tell customers what you collect through the form and why. See Your data and privacy.
If the form does not appear
Check that the form is published, that the whole snippet was pasted, and that your website is on the allowed list if you use one. The full checklist is in Troubleshooting.