Load the Device Identification agent via a GTM Custom HTML tag. Add visitor identification, bot detection, and smart signals to your Google Tag Manager application in minutes.
Add the SDK to your project with your preferred package manager.
npm install gtm-templateyarn add gtm-templatepnpm add gtm-templateGet up and running with the minimal setup.
<!-- GTM Custom HTML Tag --><script> (function() { var script = document.createElement('script'); // Public key travels in the s.js query string (?k=...) script.src = 'https://edge.tracio.ai/s.js?k=your-public-key'; script.onload = function() { window.Tracio.load() .then(function(tc) { return tc.get(); }) .then(function(result) { dataLayer.push({ event: 'tracio_loaded', visitorId: result.visitorId }); }); }; document.head.appendChild(script); })();</script>Production-ready patterns with error handling, loading states, and advanced configuration.
<!-- GTM Custom HTML Tag — production setup --><script> (function() { var script = document.createElement('script'); // Public key travels in the s.js query string (?k=...) script.src = 'https://edge.tracio.ai/s.js?k=your-public-key'; script.async = true; script.onerror = function() { dataLayer.push({ event: 'tracio_error', tracio_error_message: 'Failed to load agent script', }); }; script.onload = function() { window.Tracio.load() .then(function(tc) { return tc.get(); }) .then(function(result) { dataLayer.push({ event: 'tracio_loaded', visitorId: result.visitorId, confidence: result.confidence, verdict: result.verdict, }); }) .catch(function(err) { dataLayer.push({ event: 'tracio_error', tracio_error_message: err.message, }); }); }; document.head.appendChild(script); })();</script>All available options for initializing and configuring the SDK.
publicKeystringYour public key from the dashboard — safe to ship in the browserendpointstringCustom endpoint URL for proxy-routed deployments — an explicit URL wins over regionregionstringData region: us or eutimeoutMsnumberTimeout for the whole getResult() call, in millisecondslinkedIdstringYour internal account ID for the signed-in user, so visits sharing a device can be linkedtagstringFree-form label attached to the identification request, e.g. checkout or logindebugbooleanLogs the script lifecycle and network activity to the browser consolescriptUrlstringFull override for the agent script URL — for self-hosting or Subresource IntegrityGo deeper with the full API reference, webhook configuration, and advanced guides.
Full API reference, integration guides, and best practices.
Real-time event delivery, payload schema, and signature verification.
Configure real-time event notifications for every device identification.
Add device fingerprinting to your Google Tag Manager application in under 5 minutes.