This documentation is for website owners who are hardcoding their tags and need help tag sequencing in order to become compliant with the regulation standards of GDPR.
Quantcast Choice Considerations
Key context for getting set up.
- Per IAB Transparency and Consent Framework guidelines, Quantcast Choice enables your 3rd party vendor to obtain a valid legal basis to operate on your ad inventory.
- This requires the website owner to use JavaScript tags to ensure the ability to read consent signals before firing vendor tags. Otherwise, a vendor will be unable to legally perform their indicated purpose (advertising, analytics, etc).
- If your website uses IMG pixels, you will need to alter your code to properly pass through consent signals into the UTM parameter.
Table of Contents
1. Generating Your CMP Tag
- Follow these instructions to implement the CMP Universal tag on your domain prior to sequencing your third-party tags.
2. Third Party Tag Sequencing Setup
Background on how the Quantcast Choice tag allows for consent and legitimate interest checks:
- If you're manually invoking the function to fire your tags, make sure you listen to the addEventListener API return TCData.eventStatus = 'tcloaded' OR TCData.eventStatus = 'useractioncomplete'. These indicate the CMP has obtained the user’s choice regarding consent.
- Choice supports the TCF APIs as specified by the IAB API specification and does return the correct TCData.eventStatus.
Sample code:
The below is only for illustration and will require additional code based on the ad requests that consent is needed for.
// This sample code illustrate how to implement a addEventListener callback
// function and triggers a Google publisher tag refresh when consent is
// either available or obtained. NOTE: Please review and update this code for
// your own needs.
// Register the addEventListener at the beginning of your page load
// after the CMP JS as been loaded
__tcfapi('addEventListener', 2, function(tcData, success) {
if (success) {
if (tcData.gdprApplies) {
if (tcData.eventStatus === 'tcloaded') {
// We have consent, get the tcData string and do the ad request.
// The example here is for Google publisher tag. You may need to modify
// this code for usage in your web page.
googletag.cmd.push(function(){
googletag.pubads().refresh();
});
// print a debug message to the console
console.log('Debug: tcloaded');
} else if (tcData.eventStatus === 'useractioncomplete') {
// The user gave consent through the UI, get the tcdata string and
// do the ad request. The example here is for Google publisher tag.
// You may need to modify this code for usage in your web page.
googletag.cmd.push(function() {
googletag.pubads().refresh();
});
// print a debug message to the console
console.log('Debug: useractioncomplete');
} else {
// print a debug message to the console
console.log('Debug: tcData.eventStatus: ', tcData.eventStatus);
}
} else { /* gdpr does not apply */
// Most likely you want to make the ad request in this case
googletag.cmd.push(function() {
googletag.pubads().refresh();
});
// print a debug message to the console
console.log('Debug: gdpr doesn\'t apply');
}
}
})
More information on non-IAB vendor tag blocking setup within Quantcast Choice Premium can be found in our dedicated documentation and API index.