# Google Tag Manager (https://notert.io/docs/platforms/google-tag-manager)

Last updated 2026-11-24

If your site already runs a Google Tag Manager container, the widget can go in as a tag, with no change to your site's code.

## Before you start [#before-you-start]

- **Copy your workspace's id.** In <Key to="settings">Settings</Key>, open <Key to="settings/conversations">General</Key> under Conversations and switch <Key>Conversations</Key> on if it's off. Then open <Key to="settings/conversations/widget">Widget</Key>, press <Key>Open guide</Key>, and find your snippet under Add it to your site. Your workspace's id is the first value its `init` passes, in quotes. See [install the widget](/docs/getting-started/install-the-widget).
- **List your site's address.** Under Where it works in the install guide, check the website your container runs on is covered. See [where the widget works](/docs/widget/where-it-works).
- **Publishing rights in Tag Manager.** You need permission to publish the container, or someone who has it to publish your change.

## The tag [#the-tag]

Tag Manager may refuse newer JavaScript in a Custom HTML tag, such as the arrow functions in the install guide's snippet, and handles the `type` of the scripts it adds in its own way. So paste this version instead. It does the same as the snippet, in older syntax, and adds the widget's script itself:

```html
<script>
  window.$notert = window.$notert || [];
  window.notert = window.notert || new Proxy({}, {
    get: function (_, call) {
      if (typeof call != "string" || call == "then" || !/^[a-z]/i.test(call)) return undefined;
      return function () {
        window.$notert.push([call].concat(Array.prototype.slice.call(arguments)));
      };
    }
  });
  window.notert.init("YOUR_WORKSPACE_ID", { widget: true, theme: "page" });

  (function () {
    var src = "https://app.notert.io/embed/v1.js";
    if (document.querySelector('script[src="' + src + '"]')) return;
    var script = document.createElement("script");
    script.type = "module";
    script.async = true;
    script.src = src;
    document.head.appendChild(script);
  })();
</script>
```

Put your workspace's id in place of `YOUR_WORKSPACE_ID`. The options are those the install guide writes: for your own button rather than the round one, add `launcher: false`, and for another theme, set `theme` to `"light"`, `"dark"` or `"auto"`. Every option is in the [JavaScript reference](/docs/widget/javascript-api#init).

## Add it to your container [#add-it-to-your-container]

<Steps>
1. In Tag Manager, open your container, then **Tags**, and press **New**.
2. Under **Tag Configuration**, choose **Custom HTML** and paste the tag above.
3. Under **Triggering**, choose **All Pages**.
4. Name the tag, such as Notert widget, and save it.
5. Press **Preview** and open your site in the window it connects. Your site shows the round button once the page has loaded, and Tag Assistant lists Notert widget among the tags that fired.
6. Back in Tag Manager, press **Submit**, then **Publish**, so the change reaches every visitor.
7. Open a page of your site. Within moments, the install guide's Check it's live shows its address.
</Steps>

## Calls from your site or other tags [#calls-from-your-site-or-other-tags]

The widget's own calls, such as [`identify`](/docs/signed-in-users/identify-users) for a signed-in user or [`context`](/docs/widget/javascript-api#context) for what your page knows, can run from your site's code or from another tag once this one has fired, whether the widget has loaded yet or not: the tag keeps each call and the widget plays them back in order.

From another tag, set its tag sequencing, under **Advanced Settings**, to fire Notert widget first, or check `window.notert` exists before calling it. A token for `identify` must come from your server, never be signed in a tag: see [sign a token on your server](/docs/signed-in-users/sign-a-token).

## Behind a consent banner [#behind-a-consent-banner]

If your site uses Tag Manager's consent settings, you can hold the tag until a visitor agrees. Open the tag's **Advanced Settings**, then **Consent Settings**, choose **Require additional consent for tag to fire**, and add the consent type your banner uses for features like support chat, such as `functionality_storage`. The widget sets no cookies, and stores a key in the browser only once a visitor opens it; which category it belongs to is your call. See [what the widget records about visitors](/docs/widget/visitor-data).

If a visitor withdraws consent, the tag that already fired stays on the page until the next load. To take the widget off at once, run `window.notert.shutdown({ forget: true })` from the tag your banner fires on withdrawal. See [shutdown](/docs/widget/javascript-api#shutdown).

## Content Security Policy [#content-security-policy]

If your site sends a `Content-Security-Policy` header, it must let Tag Manager run its Custom HTML tags, which are inline scripts, and allow the widget's sources at `https://app.notert.io`. See [Content Security Policy](/docs/widget/content-security-policy) for the sources the widget needs.

<Note>
A visitor whose browser or extension blocks Tag Manager doesn't get the widget either. Where
everyone should have it, such as in your product's app, paste the snippet into your pages instead.
</Note>