Google Tag Manager Installation
Install Told via Google Tag Manager (GTM) without touching your website's source code.
1. Create a Custom HTML tag
- Open your GTM container
- Go to Tags → New
- Name the tag (e.g., "Told SDK")
- Click Tag Configuration → Custom HTML
- 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
- Click Triggering
- Select All Pages (or a specific page trigger if you only want Told on certain pages)
- 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.
Related pages
- SDK Functions — Full API reference
- CSP Configuration
- Troubleshooting