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.
This will install Intercom for logged-out visitors only. See how to Install Intercom on your web app for logged-in users.

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

To install Intercom on your website with Google Tag Manager, just follow these steps.
Note: Passing events and custom attributes are not currently supported with this method.

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:

You can also quickly copy the snippet below - just make sure you replace both placeholders ('YOUR_APP_ID') with your actual workspace ID.

Important: If you copy the code below you'll need to manually update 'YOUR_APP_ID' with your workspace ID.

<script>
    window.intercomSettings = {
        app_id: "YOUR_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/' + 'YOUR_APP_ID';
              var x = d.getElementsByTagName('script')[0];
              x.parentNode.insertBefore(s, x);
          };
          if (document.readyState === 'complete') {
              l();
          } else if (w.attachEvent) {
              w.attachEvent('onload', l);
          } else {
              w.addEventListener('load', l, false);
          }
      }
  })();
</script>


The HTML section copied from above should look like this in Google Tag Manager:

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?