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

# Google Tag Manager

> Load the Homie AI chat bubble through GTM in less than a minute.

<Note>
  GTM lets you roll out Homie without touching theme code — perfect when multiple properties share the same container.
</Note>

***

## 1 • Copy your embed script

Open the assistant in your **Homie dashboard** → **Connect** and click <kbd>Script kopieren</kbd>.

<div className="my-4">
  <img src="https://mintcdn.com/homieai/t1ZSM74lXOpzsQLS/images/integrations/connect.png?fit=max&auto=format&n=t1ZSM74lXOpzsQLS&q=85&s=ddc2630812f2d8706ba54bc3b19cb1a3" alt="Homie dashboard – Connect tab with script snippet" className="rounded-lg shadow" width="1340" height="978" data-path="images/integrations/connect.png" />
</div>

***

## 2 • Add a new tag in GTM

1. Log into **tagmanager.google.com** and select your container.
2. Click **Add a new tag** → choose **Custom HTML**.

Paste the snippet — it already contains your `chatbotId` and domain:

```html theme={null}
<script>
  (function () {
    window.homieBotConfig = {
      chatbotId: 'YOUR_CHATBOT_ID',
      domain: 'https://chat.yourhomie.ai',
    };
    var script = document.createElement('script');
    script.src = 'https://cdn.yourhomie.ai/embed.min.js';
    script.defer = true;
    if (document.readyState === 'loading') {
      document.addEventListener('DOMContentLoaded', function () {
        document.body.appendChild(script);
      });
    } else {
      document.body.appendChild(script);
    }
  })();
</script>
```

### Optional: Add Store Parameter

If you need a store parameter, add `storeId` to the configuration:

```html theme={null}
<script>
  (function () {
    window.homieBotConfig = {
      chatbotId: 'YOUR_CHATBOT_ID',
      domain: 'https://chat.yourhomie.ai',
      storeId: 'your-store-id',
    };
    var script = document.createElement('script');
    script.src = 'https://cdn.yourhomie.ai/embed.min.js';
    script.defer = true;
    if (document.readyState === 'loading') {
      document.addEventListener('DOMContentLoaded', function () {
        document.body.appendChild(script);
      });
    } else {
      document.body.appendChild(script);
    }
  })();
</script>
```

***

## 3 • Set the trigger

Choose **All Pages** so the chat bubble loads site‑wide.

<div className="my-4">
  <img src="https://mintcdn.com/homieai/t1ZSM74lXOpzsQLS/images/integrations/gtm/gtm.png?fit=max&auto=format&n=t1ZSM74lXOpzsQLS&q=85&s=81ab22811cfb5f329bc2956e16fd1027" alt="GTM – All Pages trigger" className="rounded-lg shadow" width="1496" height="1048" data-path="images/integrations/gtm/gtm.png" />
</div>

***

## 4 • Publish

Click **Submit** → **Publish**. GTM deploys the tag instantly.

That’s it — refresh your site and the Homie bubble appears in the bottom‑right corner. **Let the conversations (and sales) begin!**

***

### Troubleshooting

* **Tag fires but no bubble?** Disable any script blockers and clear cache.
* **Only on specific pages?** Adjust the trigger to a "Page View" rule.
* **Multiple environments?** Use GTM’s built‑in environments to test before production.
