Google Tag Manager

Use Google Tag Manager (GTM) to deploy and manage the attribu.tech pixel without modifying your website code directly.

Setup

  1. Log in to your Google Tag Manager account
  2. Select your container
  3. Click Tags > New
  4. Name your tag (e.g. "Attribu Analytics")
  5. Click Tag Configuration and select Custom HTML
  6. Paste the following code:
<script>
  (function() {
    var script = document.createElement('script');
    script.defer = true;
    script.setAttribute('data-website-id', 'YOUR_SITE_ID');
    script.setAttribute('data-domain', 'yourdomain.com');
    script.src = 'https://attribu.tech/js/script.js';
    document.head.appendChild(script);
  })();
</script>
Replace YOUR_SITE_ID and yourdomain.com with your actual values from the attribu.tech dashboard.
  1. Click Triggering, select All Pages, and click Add
  2. Click Save
  3. Click Submit at the top right, then Publish

Adding script options

You can add any script option as an additional setAttribute call:

<script>
  (function() {
    var script = document.createElement('script');
    script.defer = true;
    script.setAttribute('data-website-id', 'YOUR_SITE_ID');
    script.setAttribute('data-domain', 'yourdomain.com');
    script.setAttribute('data-allowed-hostnames', 'app.yourdomain.com');
    script.setAttribute('data-allow-localhost', 'true');
    script.src = 'https://attribu.tech/js/script.js';
    document.head.appendChild(script);
  })();
</script>

Tracking custom events via GTM

To send custom events from GTM triggers, create a separate Custom HTML tag:

<script>
  window.attribu && window.attribu("button_clicked", {
    button: "hero_cta"
  });
</script>

Attach this tag to whichever GTM trigger you want (e.g. a click trigger on a specific button).

Troubleshooting

  • No data appearing? Use GTM's Preview mode to check that the tag is firing
  • CSP errors? If your site has a Content Security Policy, add attribu.tech to your script-src and connect-src directives
  • Delayed data? GTM tags fire after the GTM container loads. Make sure your tag fires on All Pages as early as possible.
For advanced configuration options like proxying, cross-domain setup, or calendar tracking, see the script options reference.
Copied