Google Tag Manager
Deploy Trodo through Google Tag Manager as a custom HTML tag.
Deploy Trodo through GTM without touching your codebase. It's the same browser SDK as the script snippet, delivered as a Custom HTML tag.
Set up the tag
- In GTM, go to Tags → New → Tag Configuration → Custom HTML.
- Paste:
<script>
var script = document.createElement('script');
script.src = 'https://cdn.trodo.ai/scripts/analytics/trodo.script.min.js';
script.setAttribute('site-id', 'YOUR_SITE_ID');
script.setAttribute('auto-events', 'true');
document.head.appendChild(script);
</script>- Under Triggering, select All Pages.
- Save, then Submit to publish.
Custom events through the data layer
Push events from your site to the data layer, then forward them to Trodo with a second Custom HTML tag.
On your site:
dataLayer.push({
event: 'trodo_track',
eventName: 'signup_completed',
eventProperties: { plan: 'pro' },
});GTM Custom HTML tag, triggered on the trodo_track event:
<script>
if (window.Trodo) {
Trodo.track('{{DL - eventName}}', {{DL - eventProperties}});
}
</script>