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

# Setup the Script

An embedded landing page can be added to your site in 2 ways, either using Google Tag Manager or through manual insertion of the `<script>` into the `<head>` of your site. Instructions for both of these implementation options can be found below.

### **Using Google Tag Manager**

A Beans iD embedded landing page can be easily embedded using Google Tag Manager by following the steps below.

<Steps>
  <Step title="Add a new tag" stepNumber={1}>
    Go to [Google Tag Manager](https://tagmanager.google.com/) and select the `Add new tag` option.
  </Step>

  <Step title="Select the Custom HTML option">
    When setting up the new tag, select the `Custom HTML` option.
  </Step>

  <Step title="Add the Beans iD <script>">
    Copy the script below and paste it into the HTML tag in Google Tag Manager.

    ```text theme={null}
      <script>
        (function() {
          var hasScript = document.getElementById("beansid-script")
          if (hasScript) {
            return
          }

          var script = document.createElement("script");
          script.setAttribute("src", "https://cdn.studentbeans.com/third-party/all.js");
          script.setAttribute("async", "true");
          script.setAttribute("id", "beansid-script");
          document.head.appendChild(script);
        })();
      </script>
    ```
  </Step>

  <Step title="Trigger the script to fire on all pages">
    In the `Triggers` section of the options, set the tag to fire on all pages.
  </Step>

  <Step title="Save and publish">
    Save your tag as `beansid` and then publish your container.
  </Step>
</Steps>

### Manually add the`<script>`

Alternatively, if you don't use Google Tag Manager, you can manually add the script to your site instead. Add the `<script>` shown below inside the `<head>` tag of the HTML for the page you want the landing page to be embedded on.

```text theme={null}
<script
  src="https://cdn.studentbeans.com/third-party/all.js"
  id="beansid-script"
  async
></script>
```

The above should be included as is, there's no need to make any changes.
