Google Tag Manager is a simple solution for managing tags, snippets, and Javascript code that sends data to third parties on your website or app. You can easily add or remove snippets to your website without requiring a developer to update the code.

To install Intercom with Google Tag Manager, just follow these steps:

Important: To connect Google Tag Manager to Intercom, you must have an active Google Tag Manager account with a published container.

First, navigate to the Tags section of your Google Tag Manager account:

Next, create a new tag and name it (for example, “Intercom - Messenger”):

Next, click the “Tag Configuration” section and choose “Custom HTML” tag type:

To get the Messenger to appear on your web app, simply copy and paste the Javascript snippet from your Intercom account into the HTML section.

You can also quickly copy the snippet below.

Important: If you copy the code below you'll need to manually change your workspace ID (this is called your APP_ID in the code).

<script>
    window.intercomSettings = {
        app_id: "APP_ID"
    };
</script>
<script>
  (function() {
      var w = window;
      var ic = w.Intercom;
      if (typeof ic === "function") {
          ic('reattach_activator');
          ic('update', w.intercomSettings);
      } else {
          var d = document;
          var i = function() {
              i.c(arguments);
          };
          i.q = [];
          i.c = function(args) {
              i.q.push(args);
          };
          w.Intercom = i;
          var l = function() {
              var s = d.createElement('script');
              s.type = 'text/javascript';
              s.async = true;
              s.src = 'https://widget.intercom.io/widget/APP_ID';
              var x = d.getElementsByTagName('script')[0];
              x.parentNode.insertBefore(s, x);
          };
          if (w.attachEvent) {
              w.attachEvent('onload', l);
          } else {
              w.addEventListener('load', l, false);
          }
      }
  })();
</script>

Next, click the “Triggering” section and choose “All Pages”:

Then hit ‘Save’ and then submit the form.

Now, Intercom will be installed using your Google Tag Manager account.

Did this answer your question?