GTM
Google Tag Manager (GTM) simplifies the management and deployment of tags, code snippets, and tracking pixels on your website or web application without the need for coding changes.
If your organization currently uses Google Tag Manager or if you're contemplating its adoption, you can integrate Told into your website using GTM.
For those already employing Google Tag Manager and who have set up their source on Told, here's how to install the SDK:
Step 1: Create a variable with your source ID
Variables in Google Tag Manager act as placeholders for specific values. To install Told through GTM, you'll need to create a variable that specifies your source ID. Here's a step-by-step guide:
- Open Google Tag Manager and navigate to Variables.
- Under User-defined variables, click on New to create a new variable.
- Give the variable an appropriate name (e.g., TOLD_PROD_SOURCE_ID for production or TOLD_DEV_SOURCE_ID for development).
- Visit the Told installation page to copy your source ID. Then, return to GTM, select Constant in the Variable configuration section, and paste your source ID. Save the variable.
Step 2: Add the Told Installation Tag
Follow the instructions to create the Tag in Google Tag Manager:
-
Open Google Tag Manager and access Tags.
-
Create a new tag.
-
Name the tag (e.g., Told-init).
-
Choose Custom HTML as tag type
-
Copy and paste the following code, remembering to replace the source variable ID with the one created earlier:
<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', '{{ TOLD_PROD_SOURCE_ID }}');
</script> -
Configure the Triggering to All Pages.
-
Save
Step 3: Verify installation
Save and use Google Tag Manager's preview function to see if the tag has been triggered. If so, your source status should change to Install. No need to click on the “Verifiy installation” button when using GTM to install Told