1. Documentation
  2. Sharing and filling in
  3. Embedding on your website

Embedding on your website

Embedding a form in your website

A public form can be displayed right inside your website, in your theme's colours. Ready-to-copy snippets are on the Share and embed page, under Embed on your website, and in the API and integration menu.

1. Allow your site

In the form's Settings, choose where it may be embedded: On any site or Only on the listed sites (then enter your sites' addresses). You can also turn embedding off.

2. Add the script

Add the script to your page once:

<script src="https://votre-nom.altiusforms.com/static/sdk/altiusforms.js"></script>

3. Pick a display

In the page — the form takes the height of its content:

<div data-af-embed="PUBLIC_TOKEN"></div>

As a button — a button opens the form over the page; data-af-label sets its text:

<div data-af-popup="PUBLIC_TOKEN" data-af-label="Contact us"></div>

The public token is already filled in the snippets on the Share and embed page.

After submission

  • Add data-af-redirect="https://…" to send the visitor to a thank-you page on your site.
  • The script fires the altiusforms:submit event on the element; your code can listen to it, for example for your analytics:
<script>
document.addEventListener("altiusforms:submit", function (e) {
  console.log("Form sent", e.detail.form);
});
</script>

Without a script

If your site does not allow scripts, use the Plain iframe offered on the same page (fixed height).