A vendor grant is a boolean value that is true if an end-user has consented to all purposes assigned to a vendor. The vendor grant value is false if one or more purposes have been disallowed by the end-user. Where the vendor grant has been set to false, your organization should check which purposes have been rejected by the end-user.
Sourcepoint offers multiple methods to read the vendor grant status when your organization is using a web implementation of our CMP:
Note: Click here for additional documentation on vendor grants as described by the IAB TCF API function.
getCustomVendorConsents for IAB __tcfapi()
The IAB __tcfapi() provides a command that allows your organization to retrieve vendor grants, this command can be called with JavaScript code embedded in a webpage or through the browser console.
function callback_fn(data, success) {
// your custom callback code can be included here
console.log(data, success)
}
// call the __tcfapi() function with callback only
__tcfapi('getCustomVendorConsents', 2, callback_fn);
__tcfapi('getCustomVendorConsents', 2, function(data, success) {console.log("getCustomVendorConsents response: ", data, " + ", success);});
The grants section in the JSON response using the TCF API getCustomVendorConsents request lists the consented purposes for each vendor. The variable vendorGrant provides the vendor grant status.
The consented purposes are listed as follows:
| Parameter | Description |
vendor_id |
Vendor ID |
purpose_id |
Purpose ID |
status |
Status is true if the purpose applies to an end-user. |
vendorGrant |
Status is |
grants:
5e37fc3e56a5e6614776722e:
purposeGrants: {
6011ea75c5d9c787531b3ecf: true,
6011ea75c5d9c787531b3ed6: true,
6011ea75c5d9c787531b3ede: true,
6011ea75c5d9c787531b3efd: true,
6011ea75c5d9c787531b3f0e: true,
6011ea75c5d9c787531b3f05: true,
6011ea75c5d9c787531b3f18: true
},
vendorGrant: true
onConsentReady function for Unified SDK for web
Sourcepoint offers an optional callback function onConsentReady through its Unified SDK implementation that allows your organization to read vendor grants. This command can be called with JavaScript code embedded in a webpage:
//Example
...
<script>
window._sp_queue = [];
window._sp_ = {
config: {
accountId: ACCOUNT_ID,
baseEndpoint: 'https://cdn.privacy-mgmt.com',
gdpr: { },
propertyHref: 'https://yourexamplehere.com',
events: {
onConsentReady: function (message_type, consentUUID, euconsent) {
console.log('onConsentReady', message_type);
console.log('consentUUID', consentUUID)
console.log('euconsent', euconsent)
}
}
}
}
</script>
...
An example of the JSON response using a Sourcepoint optional onConsentReady event callback is shown below. The variable consentedToAll gives the vendor grant status:
consentedToAll: "true"
Comments
0 comments