AtlasCustomer PortalGo to Atlas

No results

Google Tag Manager

Last updated July 20, 2024

Install with Google Tag Manager

In your Google Tag Manager account, go to Tags, create a new Custom HTML one and assign it a name, e.g. Atlas Snippet.

Add the following code snippet to the HTML block:

<script>(function (){"use strict";var t,e={appId:"YOUR_APP_ID",v:2,q:[],call:function(){this.q.push(arguments)}};window.Atlas=e;var n=document.createElement("script");n.async=!0,n.src="<https://app.atlas.so/client-js/atlas.bundle.js>";var s=document.getElementsByTagName("script")[0];null===(t=s.parentNode)||void 0===t||t.insertBefore(n,s)})();

window.Atlas.call("start");
</script>

Add All Pages as the trigger.

Publish the tag.

Identify your users

Prerequisites

You need to have user fields set up as variables and User Login event set up as a trigger. Usually, your engineering team will pass variables and events to GTM via the data layer.

Create another Custom HTML tag named Atlas Identification. Add the following code snippet to the HTML block and modify variable names accordingly:

<script> (function() {
  window.Atlas.call("identify", {
     userId: "{{User ID}}",
     name: "{{User Name}}",
     email: "{{User Email}}"
  })
})();
</script>

Note that {{GTM variables}} are wrapped with quotes.

Add User Login as the trigger.

Publish the tag.

Was this article helpful?