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

# Embeds

> Render a Tally form inline on your website using an iframe and the Tally widget script.

The standard embed renders a Tally form inside an `<iframe>` on your own page. The widget
script lazy-loads each embed, forwards the page URL and query parameters to the form, and
exposes a `window.Tally` object for manual control.

## Add the widget script

Include the Tally widget script once on any page that contains an embed:

```html theme={null}
<script src="https://tally.so/widgets/embed.js"></script>
```

## Add an embed

Place the embed HTML wherever you want the form to appear. The `data-tally-src` attribute
holds the embed URL — copy the one from the **Share** tab of your form.

```html theme={null}
<iframe
  data-tally-src="https://tally.so/embed/mRoDv3?alignLeft=1&hideTitle=1&transparentBackground=1&dynamicHeight=1"
  loading="lazy"
  width="100%"
  height="200"
  frameborder="0"
  marginheight="0"
  marginwidth="0"
  title="Newsletter"></iframe>
```

## Tally.loadEmbeds()

Embeds aren't loaded by the script alone — call `Tally.loadEmbeds()` after the script has
loaded:

```javascript theme={null}
Tally.loadEmbeds();
```

Embeds in the viewport (or within 500px of its edges) are loaded immediately. The rest are
loaded lazily via an `IntersectionObserver` as they scroll into view.

<Note>
  If you're rendering embeds in a SPA, see the [React](/widgets/examples/react) and
  [Next.js](/widgets/examples/nextjs) examples for the correct loading pattern.
</Note>

## Save page URL and query parameters

The widget automatically forwards the host page's path and query parameters to the embed.
To capture them in your submissions, add matching [hidden fields](https://tally.so/help/hidden-fields)
to your form.

For example, given the page URL:

```
https://company.com/register?ref=downloads&email=alice@example.com
```

Hidden fields named `originPage`, `ref`, and `email` will receive the following values:

| Hidden field | Value                                         |
| ------------ | --------------------------------------------- |
| originPage   | /register                                     |
| ref          | downloads                                     |
| email        | [alice@example.com](mailto:alice@example.com) |

## Events

Embeds emit JavaScript events when the form is loaded, when the respondent navigates between
pages, and when the form is submitted. See [Events](/widgets/events) for the full payload
reference.
