---
title: "Install the chat widget with Google Tag Manager"
description: "Add Retily's chat widget through Google Tag Manager: the Tag Manager code from the app, a Custom HTML tag on every page, then publish."
url: https://retily.com/help/install-google-tag-manager
language: en
last_modified: 2026-10-28
---

[Help](https://retily.com/help)

# Install with Google Tag Manager

If your site loads its scripts through Google Tag Manager, add the chat widget there too. It needs the Tag Manager version of the code, not the one-line code.

Last updated October 28, 2026

## 1. Copy the Tag Manager code in Retily

1. In the app, go to **Settings › Widget**.
2. Next to your chat widget, click **Install**.
3. Under **Add it to every page of your site**, choose **Google Tag Manager**.
4. Click **Copy Tag Manager code**.

It is a few lines, with your own workspace name:

```
<script>
  (function () {
    var s = document.createElement("script");
    s.src = "https://app.retily.com/v1/widget.js";
    s.setAttribute("data-org", "your-workspace");
    document.head.appendChild(s);
  })();
</script>
```

### Why not the one-line code?

Tag Manager rewrites a pasted script tag and drops its data-org, so the widget would not know which workspace it belongs to and would show nothing.

## 2. Make the tag

1. In your Tag Manager container, go to **Tags** and click **New**.
2. Click **Tag Configuration** and choose **Custom HTML**. Paste the code.
3. Under **Triggering**, choose a trigger that fires on every page. Every web container has **Initialization - All Pages**.
4. Click **Save**.

## 3. Publish

1. Click **Submit**, at the top right.
2. Keep **Publish and Create Version** selected, then click **Publish**.

## 4. Check it

Tag Manager adds the widget after the page opens, so the check can’t see it in your page’s HTML. Open your site once in a browser, then run the check:

1. Back in Retily’s install dialog, under **Check your site**, type your site’s address.
2. Click **Check installation**. Once the widget has loaded on your site, it says **Installed**.

- A second chat widget has its own Tag Manager code, with a data-widget line too. Copy it from that widget’s Install.
- Still no chat? Look at the widget’s **Allowed Domains**, as [Install the chat widget](https://retily.com/help/install-widget#check) explains.

## Related

- [Install the chat widget](https://retily.com/help/install-widget)
- [White label your widget](https://retily.com/help/white-label-widget)
- [API](https://retily.com/help/api)
- [All features](https://retily.com/features)
- [Plans and pricing](https://retily.com/pricing)

## Still stuck?

Write to support@retily.com with your support email address and what you tried. Or see [all help pages](https://retily.com/help).
