Installing the Vector Pixel via Termly's Consent Management Platform
Last updated: September 15, 2026
This guide explains how to integrate the Vector pixel with Termly's Consent Management Platform (CMP). This setup allows the Vector pixel to load only after a visitor has provided the appropriate consent.
Important Privacy Notice
As a website operator, you are responsible for respecting your visitors' privacy rights and complying with applicable privacy laws and regulations, such as GDPR, CCPA, and others.
Using Termly provides one way to manage visitor consent before loading the Vector pixel, but implementing a CMP does not by itself guarantee compliance. Always:
Be transparent about your data collection practices.
Obtain appropriate consent where required.
Honor visitor privacy choices.
Maintain up-to-date privacy policies.
Regularly review your privacy practices.
Vector also supports Global Privacy Control (GPC) signals. Learn more about Global Privacy Control (GPC) and how Vector handles GPC signals.
Before You Get Started: Consent and Website Identification
When you configure Termly to block the Vector pixel until consent is granted, Vector cannot identify or process website activity for a visitor until the pixel is allowed to load.
This means website identification volume may be lower when the pixel is placed behind consent because only visitors who provide the required consent will be eligible for identification.
This is expected behavior. Vector will respect the consent configuration you've established through your CMP and will begin processing eligible website activity once the pixel is permitted to load.
Implementation Overview
This integration configures the Vector pixel to load after a visitor grants advertising consent through Termly.
The implementation:
Checks the visitor's current Termly consent state.
Loads the Vector pixel when the required consent has been granted.
Listens for changes to the visitor's consent preferences.
Keeps the Vector pixel from loading when the required consent has not been granted.
1. Add the Consent Monitoring Script
Add the following JavaScript code to your website:
<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();
});
}
// Handle cases where Termly loads after our script
document.addEventListener('DOMContentLoaded', (event) => {
if (window.Termly && typeof window.Termly.getConsentState === 'function') {
checkAdvertisingConsent();
}
});
</script>
Replace YOUR-INSTALL-CODE-HERE with your organization's Vector install code.
2. Update Your Termly Embed Script
Modify your Termly embed script to include the onload attribute:
<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.
How It Works
Once configured, Termly controls whether the Vector pixel is allowed to load based on the visitor's consent state:
Initial page load: The integration checks for an existing consent preference before loading the Vector pixel.
Termly initialization: The visitor's consent status is checked when Termly initializes.
Consent changes: The integration listens for changes to the visitor's consent preferences.
Pixel loading: If the required consent is granted, the Vector pixel loads and eligible website activity can begin being processed.
No consent: If the required consent has not been granted, the Vector pixel remains blocked and Vector will not identify or process that visitor's website activity through the pixel.
Because identification only begins after the required consent is granted, the number of identified website visitors may be lower than it would be without consent-based pixel blocking.
Global Privacy Control (GPC)
Global Privacy Control, or GPC, is a browser-level privacy signal visitors can use to communicate their privacy preferences.
Vector supports GPC signals as part of its approach to website identification and visitor privacy.
For details on how GPC works with Vector, including how it can affect website identification, see What to Know About Global Privacy Control (GPC) and Vector.
Best Practices for Privacy Compliance
Clear Disclosure
Explain your use of website identification technology in your privacy policy.
Describe what data you collect and how it's used.
Be transparent about applicable data sharing practices.
Consent Management
Configure the appropriate consent categories in Termly.
Don't load the Vector pixel before the consent required by your organization has been provided.
Give visitors an accessible way to change their preferences.
Data Handling
Only collect data necessary for your use case.
Implement appropriate data retention policies.
Maintain appropriate security practices.
Have processes in place for applicable data subject requests.
Regular Review
Periodically review your privacy practices.
Update your documentation as needed.
Monitor changes in applicable privacy regulations.
Maintain appropriate consent records.
Troubleshooting
The Vector Pixel Isn't Loading
Verify that the visitor has granted the required consent.
Check your browser console for errors.
Confirm Termly is properly initialized.
Confirm you've replaced
YOUR-INSTALL-CODE-HEREwith your Vector install code.
Website Identification Volume Is Lower Than Expected
If Termly is configured to block the Vector pixel until consent is granted, lower identification volume can be expected.
Visitors who don't provide the required consent will not load the Vector pixel and therefore won't be eligible for website identification through the pixel.
Consent Isn't Being Detected
Confirm the Termly embed script is loading.
Verify your Termly consent categories are configured correctly.
Confirm the script is checking the intended consent category.
Check your browser console for JavaScript errors.
Getting Help
If you encounter implementation issues:
Review your browser console for error messages.
Verify that both scripts are implemented correctly.
Check your Termly consent configuration.
Contact our support team if problems persist.
For questions about privacy compliance or legal requirements, consult your legal advisors.