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'); script.src = 'https://your-domain.com/tracio-agent.js'; script.onload = function() { Tracio.load({ apiKey: 'your-key' }) .then(tc => tc.get()) .then(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'); script.src = 'https://your-domain.com/tracio-agent.js'; script.async = true; script.onerror = function() { dataLayer.push({ event: 'tracio_error', tracio_error_message: 'Failed to load agent script', }); }; script.onload = function() { Tracio.load({ apiKey: 'your-key', endpoint: 'https://api.tracio.ai', region: 'eu', }) .then(function(tc) { return tc.get({ extendedResult: true }); }) .then(function(result) { dataLayer.push({ event: 'tracio_loaded', visitorId: result.visitorId, confidence: result.confidence.score, incognito: result.incognito, botDetected: result.bot && result.bot.result !== 'notDetected', requestId: result.requestId, }); }) .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.
apiKeystringYour API key from the dashboardendpointstringCustom endpoint URL for proxy-routed deploymentsregionstringData region (us, eu, ap)timeoutnumberRequest timeout in millisecondsextendedResultbooleanAdds bot detection, incognito mode flags, and smart signalslinkedIdstringCustom identifier to associate visits (e.g. user ID or session ID)Go deeper with the full API reference, webhook configuration, and advanced guides.
Full API reference, integration guides, and best practices.
Server API endpoints, request/response schemas, and error codes.
Configure real-time event notifications for every device identification.
Add device fingerprinting to your Google Tag Manager application in under 5 minutes.