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

# Install Brudcast forms with Google Tag Manager

> Add the popup site script to every page with a Custom HTML tag, and place an embedded form with a tag on chosen pages.

Google Tag Manager can add the Brudcast site script to every page of your site without editing
its code. Popups then work on every page the container runs on.

**Screenshot coming soon**

A Google Tag Manager Custom HTML tag holding the Brudcast site script, with the All Pages trigger

> [!NOTE]
>
> **Before you start:** add the website under **Contacts > Forms > Websites** and copy its install
> snippet. See [Add a website](/forms/popups.md#add-a-website). Your site must already load your
> Google Tag Manager container.

## Install the site script

**1. Create a tag**

In your container, go to **Tags** and select **New**. Name it `Brudcast site script`.

**2. Paste the snippet**

Select **Tag Configuration**, choose **Custom HTML**, and paste the install snippet:

```html theme={"system"}
<script src="https://forms.brudcast.com/site.js" data-site="your_site_key" async></script>
```

**3. Fire it on every page**

Select **Triggering** and choose **All Pages**. Save the tag.

**4. Preview, then publish**

Select **Preview** to check the tag fires, then **Submit** and **Publish** the container.
Open your site, and the website in Brudcast changes to **Connected**.

> [!NOTE]
>
> If the site script is also in your site's theme, leave both. It only runs once on a page.

## Embed a form on chosen pages

The script embed needs a `div` in the page where the form goes, and Tag Manager can't place
content inside your page reliably. Add the `div` to the page in your site's own editor, then load
the embed script from Tag Manager:

1. Paste `<div data-brudcast-form="your_form_id"></div>` where the form should appear.
2. Create a **Custom HTML** tag with
   `<script src="https://forms.brudcast.com/embed.js" async></script>`.
3. Trigger it on **Page View** for the pages that carry the form, or on **All Pages**.

If your site adds the `div` after the page loads, add `window.BrudcastForms.mount()` to a tag that
fires once it's there.

## Related

> **[Popups](/forms/popups.md)**
>
> Create the popups the script shows.

> **[Embed a form](/forms/embed-a-form.md)**
>
> Embed variants, layouts and prefill.


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