Skip to main content

Google Tag Manager Installation

Install Told via Google Tag Manager (GTM) without touching your website's source code.

1. Create a Custom HTML tag

  1. Open your GTM container
  2. Go to Tags → New
  3. Name the tag (e.g., "Told SDK")
  4. Click Tag Configuration → Custom HTML
  5. Paste the following code:
<script>
(function (w, d, e, v, o, l, t) {
w['ToldWidget'] = o;
w[o] = w[o] || function () { (w[o].q = w[o].q || []).push(arguments); };
w[o].l = 1 * new Date();
l = document.createElement(e);
t = document.getElementsByTagName(e)[0];
l.async = 1;
l.src = v;
t.parentNode.insertBefore(l, t);
})(window, document, 'script', 'https://scripts.told.club/sdk/sdk.js', 'told');

told('init', 'YOUR_SOURCE_ID');
</script>

Replace YOUR_SOURCE_ID with your Source ID from the Told dashboard.

2. Set the trigger

  1. Click Triggering
  2. Select All Pages (or a specific page trigger if you only want Told on certain pages)
  3. Save the tag

3. Publish

Click Submit to publish the GTM container. The Told SDK will load on all pages matching the trigger.

Identify users via GTM

To identify users, create a second Custom HTML tag that fires after authentication:

<script>
told('identify', {
email: '{{User Email}}',
userId: '{{User ID}}',
});
</script>

Replace {{User Email}} and {{User ID}} with your GTM variables.

tip

The SDK automatically captures events pushed to dataLayer. If you already track events via GTM, you can use them directly as survey triggers in Told — no extra code needed. See Automatic event capture.