> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trybrein.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Embed on your site

> Place a Formulario inside your own web page with a snippet and three display modes.

The embed loads the public form in an `iframe` and adjusts its height on its own. Paste this snippet where you want the form to appear:

```html theme={"theme":"github-light"}
<script src="https://trybrein.com/embed.js" async></script>
<div data-brein-form="frm_AbC123dEf4" data-mode="inline"></div>
```

`data-brein-form` holds the form's public id (the same one in its link) and `data-mode` is `inline`, `popup`, or `slide`.

## The three modes

| Mode | What it does |
| - | - |
| `inline` | The form appears in place, in the page flow. |
| `popup` | A button opens the form in a centered window. Change the button text with `data-button-text`. |
| `slide` | The form appears in a corner, with a close button. |

For `popup` you can also open it from your own code with `window.BreinForms.open("frm_AbC123dEf4")`.

## Allowed domains

If you set **Dominios permitidos** in the form, only those sites can show an embedded form; leave the list empty and any site can. Write one domain per line; a `*.dominio.mx` entry accepts its subdomains. A browser submission from a site that is not allowed is rejected with `403`.

## The `brein:submitted` event

When a response is accepted, the embed fires a `brein:submitted` event on the form's element, with `detail.formId` and `detail.responseId`. Use it to count a conversion, for example in Google Analytics:

```html theme={"theme":"github-light"}
<script>
  document.addEventListener('brein:submitted', function (event) {
    if (typeof gtag === 'function') {
      gtag('event', 'generate_lead', { form_id: event.detail.formId })
    }
  })
</script>
```

## Related

* [Share by link](/forms/share-by-link)
* [Send from your server](/forms/from-your-server)
* [Privacy and consent](/forms/privacy-and-consent)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.