Publish Web Messenger via Google Tag Manager

Prev Next

Use Google Tag Manager (GTM) to add MindBehind Web Messenger to your website. First, copy the script from your Web Messenger channel. Then, add it to a Custom HTML tag in GTM.

Before you begin

  • Make sure you have a Web Messenger channel connected to your assistant.

  • Make sure your GTM container is installed on your website. If you have not set up GTM yet, create an account and a web container, then follow the installation instructions provided by GTM.

For setup instructions, refer to Integrate Web Messenger or Integrate Web Messenger V2.

Copy the Web Messenger script

  1. In MindBehind Flow, navigate to Companies and select the company that owns your assistant.

  2. Open the Channels tab.

  3. Find the Web Messenger channel you want to publish and click Update.

  4. Open the Getting Started tab.

  5. Select and copy the Web Messenger script displayed in this tab. You will paste this script into GTM in the next section.

Use the script copied from your own Web Messenger channel, not a sample script.

Add the script to Google Tag Manager

If the Web Messenger script is already added directly to your website code, do not add it again through GTM. Adding the script in both places loads the widget twice.

  1. Open the GTM container installed on your website.

  2. Navigate to Tags and click New.

  3. Enter a descriptive name for the tag, such as MindBehind Web Messenger.

  4. Open Tag Configuration and select Custom HTML.

  5. Paste the complete script you copied from the Getting Started tab into the HTML field, including the opening and closing <script> tags.

  6. Open Triggering and select All Pages to display Web Messenger across your website. To display it only on selected pages, use a Page View trigger with conditions that match those pages.

  7. Click Save.

Test and publish

  1. Click Preview in GTM and connect to your website.

  2. Open a page where the tag should fire.

  3. Confirm that the Web Messenger tag fires and that the widget appears on the page.

  4. Open the widget and send a test message to check that your assistant responds.

  5. If you configured the tag for selected pages only, also check a page that should not display the widget.

  6. After testing, return to GTM and click Submit.

  7. Enter a version name and description, then click Publish.