message.comDevelopers

Install live chat via Google Tag Manager

If your site already loads Google Tag Manager (GTM), you can install message.com chat with a Custom HTML tag in five minutes. No code changes to the site itself.

Before you begin

  • GTM already installed on the site (you should see gtm.start in View Source).
  • Edit access to the GTM container.
  • Your install snippet from Settings → Chats → Installation in message.com.
HTML
<script>
  (function(d,s,o){
    var j=d.createElement(s);j.async=1;j.src='https://app.message.com/widget.js';
    j.dataset.workspace=o;
    d.head.appendChild(j);
  })(document,'script','YOUR_WORKSPACE_ID');
</script>

1. Open your GTM workspace

  1. Sign in to tagmanager.google.com.
  2. Pick the container for your site.
  3. You should see the Workspace view with Tags and Triggers in the left nav.

2. Create a Custom HTML tag

  1. Open Tags. Click New.
  2. Name the tag message.com chat.
  3. Click Tag Configuration → Custom HTML.
  4. Paste the snippet into the HTML field.
  5. Leave the legacy Support document.write option unchecked.

3. Set the trigger

  1. Click Triggering.
  2. Choose All Pages (the built-in trigger).
  3. Click Save.

For an SPA, All Pages fires on the initial pageview. The widget bundle is route-agnostic and survives client-side navigation, so you do not need a History Change trigger.

4. Preview, then publish

  1. Click Preview. GTM opens Tag Assistant on your site.
  2. Confirm the new tag fires on Container Loaded.
  3. Return to GTM. Click Submit, name the version (e.g., v1 add message.com chat), and Publish.

5. Verify the install

  1. Open the site in a private window (no Tag Assistant).
  2. The launcher appears in the bottom-right within two seconds.
  3. Open the browser console. Confirm the [message] startup log.
  4. Send a test message. The conversation lands in app.message.com.

Common pitfalls

  • Consent Mode v2. If GTM is wired to Consent Mode, the tag may be blocked until the visitor accepts the relevant consent category. Either set Consent Settings → No additional consent required on this tag, or add the right consent category. Chat is generally considered functional.
  • Cookie banner blocks the launcher. Some cookie banners stretch the full viewport, hiding the launcher. Either raise the launcher z-index, or move the banner.
  • GTM container not on the page. The Custom HTML tag only runs when the container itself loads. Double-check the container snippet is in <head> on every page.
  • Tag pause. Confirm the tag's Tag firing options are set to Once per page (default).

Next steps