Google Tag Manager installation

Put a chatbot on the pages you choose with GTM.

If your site already uses a Google Tag Manager web container, you can publish a Botforger launcher from the same workspace and choose exactly which page loads trigger it.

The Botforger robot studies three chat bubbles on a phone propped on a desk
Google Tag Manager Custom HTML

Add a Custom HTML tag

Use the web container already installed on the site. You need edit access to configure the tag, and someone with Publish permission must release the container version.

Documentation from Google Tag Manager
  1. Get the Tag Manager snippet

    Open Install in your Botforger workspace and choose Google Tag Manager. Copy the complete code shown for your assistant. In GTM, open Tags, choose New, and select Custom HTML.

  2. Choose the pages that should load the launcher

    Paste the code and add a Page View trigger. Choose All Pages for the whole site, or Some Page Views with a Page Path filter for one section. If the container serves several domains, include a Page Hostname condition for the intended site.

  3. Preview, then publish the tested version

    Start Preview and connect Tag Assistant to a page that should show the widget. Open an excluded page separately and check its tag results too. Once the scope is correct, use Submit and publish the container to the intended environment.

Embed code

Get your snippet.

Enter the public assistant ID from your studio to personalize this example. Your ready-made code is also available under Install in Botforger.

Google Tag Manager
<script>
(function () {
  var id = "botforger-loader-YOUR_ASSISTANT_ID";
  if (document.getElementById(id)) return;
  var script = document.createElement("script");
  script.id = id;
  script.src = "https://chats.botforger.com/widget.js";
  script.setAttribute("data-bot", "YOUR_ASSISTANT_ID");
  script.async = true;
  document.head.appendChild(script);
})();
</script>

Paste this code into a Custom HTML tag in your web container.

A visitor guide for an open-studios weekend

Suppose an arts group publishes a public studio trail and a separate area for volunteers. Someone walking the trail wants the step-free entrance for the next venue. The volunteer area already has its own staff contacts. Use the same web container and limit the public assistant to the visitor pages.

Two keys with an envelope and a chat bubble engraved on their faces

Match the trigger to the visitor route

Include the whole programme
If every visitor guide lives under /visit/, set a Page View trigger where Page Path starts with /visit/. Include the actual overview address in the test, especially if the site serves /visit without the final slash.
Start with one venue
For a trial at a single studio, match that venue’s exact page path and the public hostname. A path-only rule could also match a staging site that uses the same container.

Check both sides of the trigger

Use Tag Assistant while testing the draft. After publication, repeat the visitor journey outside the preview session.

Google’s guide to verifying and publishing tags
Did the tag fire on the intended page?
On a venue page, inspect the Page View event and find the Botforger tag in the list of fired tags. Then open the chat on the actual page and ask where the step-free entrance is.
Does it stay off the volunteer page?
Open a volunteer URL directly in a fresh tab and inspect its Page View event. If your site changes routes without reloading, also navigate from a venue to the volunteer area. A widget already loaded can stay on the screen.
Did the correct version go live?
Check that the published container version contains the tag and the trigger you tested. Revisit both public URLs in a window without Tag Assistant connected.
FAQ

Frequently asked questions

Do I also need to install the script in my theme?

The Tag Manager snippet loads the widget. Check whether the same assistant is already installed directly in the theme before adding the GTM tag. Keeping one installation makes future changes easier to track.

Why do I see the assistant in Preview but my visitors do not?

Preview can run unpublished workspace changes. Check that the live domain uses the intended container and that a user with Publish permission released the version containing your tag.

Get the widget code for your container.

Build my chatbot