This guide explains how to properly integrate Vector's visitor de-anonymization technology with Termly's Consent Management Platform (CMP). This integration ensures your de-anonymization features only activate when visitors have granted appropriate consent.
Privacy Compliance Responsibility: As a website operator, you are responsible for respecting your visitors' privacy rights and complying with all applicable privacy laws and regulations (such as GDPR, CCPA, and others). This integration with Termly provides one way to manage visitor consent for de-anonymization technology, but implementing it does not guarantee compliance. Always:
Be transparent about data collection practices
Obtain proper consent before activating de-anonymization features
Honor visitor privacy choices
Maintain up-to-date privacy policies
Regularly review and update your privacy practices
This integration ensures your de-anonymization script only loads after a visitor has granted advertising consent through Termly. This respects visitor privacy choices while maintaining functionality for users who opt-in.
Add the following JavaScript code to your website:
HTML
1<script> 2function checkAdvertisingConsent() { 3 if (window.Termly && typeof window.Termly.getConsentState === 'function') { 4 const consentState = window.Termly.getConsentState(); 5 // IF YOU WANT TO CHECK A PERMISSION OTHER THAN "ADVERTISING", CHANGE THE LINE BELOW 6 if (consentState.advertising === true) { 7 // START OF YOUR VECTOR INSTALL CODE: REPLACE WITH YOURS 8 !function(e,r){try{if(e.vector)return void console.log("Vector snippet included more than once.");var t={};t.q=t.q||[];for(var o=["load","identify","on"],n=function(e){return function(){var r=Array.prototype.slice.call(arguments);t.q.push([e,r])}},c=0;c<o.length;c++){var a=o[c];t[a]=n(a)}if(e.vector=t,!t.loaded){var i=r.createElement("script");i.type="text/javascript",i.async=!0,i.src="https://cdn.vector.co/pixel.js";var l=r.getElementsByTagName("script")[0];l.parentNode.insertBefore(i,l),t.loaded=!0}}catch(e){console.error("Error loading Vector:",e)}}(window,document); 9 vector.load("YOUR-INSTALL-CODE-HERE"); 10 // END OF YOUR VECTOR INSTALL CODE 11 return true; 12 } 13 } 14 return false; 15} 16 17// Function that will be called when Termly is loaded 18function onTermlyLoaded() { 19 // Check initial consent state 20 checkAdvertisingConsent(); 21 22 // Listen for initialization 23 Termly.on('initialized', (data) => { 24 checkAdvertisingConsent(); 25 }); 26 27 // Listen for consent changes 28 Termly.on('consent', (data) => { 29 checkAdvertisingConsent(); 30 }); 31} 32 33// Add event listener for DOM content loaded to handle cases where Termly loads after our script 34document.addEventListener('DOMContentLoaded', (event) => { 35 // Check if Termly is already loaded 36 if (window.Termly && typeof window.Termly.getConsentState === 'function') { 37 checkAdvertisingConsent(); 38 } 39}); 40</script>
<script> function checkAdvertisingConsent() { if (window.Termly && typeof window.Termly.getConsentState === 'function') { const consentState = window.Termly.getConsentState(); // IF YOU WANT TO CHECK A PERMISSION OTHER THAN "ADVERTISING", CHANGE THE LINE BELOW if (consentState.advertising === true) { // START OF YOUR VECTOR INSTALL CODE: REPLACE WITH YOURS !function(e,r){try{if(e.vector)return void console.log("Vector snippet included more than once.");var t={};t.q=t.q||[];for(var o=["load","identify","on"],n=function(e){return function(){var r=Array.prototype.slice.call(arguments);t.q.push([e,r])}},c=0;c<o.length;c++){var a=o[c];t[a]=n(a)}if(e.vector=t,!t.loaded){var i=r.createElement("script");i.type="text/javascript",i.async=!0,i.src="https://cdn.vector.co/pixel.js";var l=r.getElementsByTagName("script")[0];l.parentNode.insertBefore(i,l),t.loaded=!0}}catch(e){console.error("Error loading Vector:",e)}}(window,document); vector.load("YOUR-INSTALL-CODE-HERE"); // END OF YOUR VECTOR INSTALL CODE return true; } } return false; } // Function that will be called when Termly is loaded function onTermlyLoaded() { // Check initial consent state checkAdvertisingConsent(); // Listen for initialization Termly.on('initialized', (data) => { checkAdvertisingConsent(); }); // Listen for consent changes Termly.on('consent', (data) => { checkAdvertisingConsent(); }); } // Add event listener for DOM content loaded to handle cases where Termly loads after our script document.addEventListener('DOMContentLoaded', (event) => { // Check if Termly is already loaded if (window.Termly && typeof window.Termly.getConsentState === 'function') { checkAdvertisingConsent(); } }); </script>
Modify your Termly embed script to include the onload attribute:
HTML
1<script 2 type="text/javascript" 3 src="https://app.termly.io/resource-blocker/your-id-here?autoBlock=on" 4 onload="onTermlyLoaded()"> 5</script>
<script type="text/javascript" src="https://app.termly.io/resource-blocker/your-id-here?autoBlock=on" onload="onTermlyLoaded()"> </script>
Replace your-id-here with your Termly resource blocker ID.
The integration manages de-anonymization consent in several ways:
Initial Page Load: Checks for existing consent before activating any features
Termly Initialization: Verifies consent status when the CMP loads
Consent Changes: Monitors for changes in visitor preferences
Conditional Loading: Only loads de-anonymization technology when explicit consent is granted
Clear Disclosure:
Clearly explain your use of de-anonymization technology in your privacy policy
Describe what data is collected and how it's used
Be transparent about any data sharing practices
Consent Management:
Use appropriate consent categories in Termly
Don't activate de-anonymization features without consent
Provide easy ways for visitors to change their preferences
Data Handling:
Only collect necessary data
Implement appropriate data retention policies
Ensure secure data storage and transmission
Have processes in place for data subject access requests
Regular Review:
Periodically review privacy practices
Update documentation as needed
Monitor changes in privacy regulations
Maintain records of consent
Script Not Loading:
Verify consent has been granted
Check browser console for errors
Ensure Termly is properly initialized
Consent Detection Issues:
Confirm Termly embed script is loading
Verify consent categories are properly configured
Check for any JavaScript errors
If you encounter implementation issues:
Review browser console for error messages
Verify all scripts are properly implemented
Check your Termly configuration
Contact support if problems persist
Review your local privacy laws and regulations
Consult with privacy professionals when needed
Stay informed about privacy best practices
Regularly audit your privacy compliance
For technical support with this integration, please contact our support team.
For questions about privacy compliance or legal requirements, please consult with your legal advisors.