Device Intelligence for Google Tag Manager
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.
Quick Install
Add the SDK to your project with your preferred package manager.
npm install gtm-templateyarn add gtm-templatepnpm add gtm-templateBasic Usage
Get 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>Advanced Patterns
Production-ready patterns with error handling, loading states, and advanced configuration.
Full GTM Integration with Data Layer Push — Click to expand
<!-- 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://your-domain.com/fp', 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>Configuration Options
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)Next Steps
Go deeper with the full API reference, webhook configuration, and advanced guides.
Documentation
Full API reference, integration guides, and best practices.
API Reference
Server API endpoints, request/response schemas, and error codes.
Webhooks
Configure real-time event notifications for every device identification.
Get started with Google Tag Manager
Add device fingerprinting to your Google Tag Manager application in under 5 minutes.