Vendor grants (Web)
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:
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. The following is an example of both:
Javascript code
Browser console
1
function callback_fn(data, success) {
2
// your custom callback code can be included here
3
console.log(data, success)
4
}
5
6
// call the __tcfapi() function with callback only
7
__tcfapi('getCustomVendorConsents', 2, callback_fn);
Copied!
1
__tcfapi('getCustomVendorConsents', 2, function(data, success) {console.log("getCustomVendorConsents response: ", data, " + ", success);});
Copied!
An example of the JSON response using a TCF API request is shown below. The variable vendorGrant gives the vendor grant status:
JSON response
The grants section in the response using the TCF API "getCustomVendorConsents" request lists the consented purposes for each vendor. 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 true if all purposes for a vendor apply to an end-user. Status is false if one or more purposes for a vendor do not apply to an end-user.
The vendorGrant status is set to true if the end-user has granted consent to all purposes assigned to a vendor. If the end-user denies consent for one or more purposes then the vendorGrant status is set to false.
1
grants:
2
5e37fc3e56a5e6614776722e:
3
purposeGrants: {
4
6011ea75c5d9c787531b3ecf: true,
5
6011ea75c5d9c787531b3ed6: true,
6
6011ea75c5d9c787531b3ede: true,
7
6011ea75c5d9c787531b3efd: true,
8
6011ea75c5d9c787531b3f0e: true,
9
6011ea75c5d9c787531b3f05: true,
10
6011ea75c5d9c787531b3f18: true
11
},
12
vendorGrant: true
Copied!

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:
Function
1
//Example
2
...
3
<script>
4
window._sp_queue = [];
5
window._sp_ = {
6
config: {
7
accountId: ACCOUNT_ID,
8
baseEndpoint: 'https://cdn.privacy-mgmt.com',
9
ccpa: { },
10
gdpr: { },
11
propertyHref: 'https://yourexamplehere.com',
12
13
events: {
14
onConsentReady: function (message_type, consentUUID, euconsent) {
15
console.log('onConsentReady', message_type);
16
console.log('consentUUID', consentUUID)
17
console.log('euconsent', euconsent)
18
}
19
}
20
21
}
22
}
23
</script>
24
...
Copied!
An example of the JSON response using a Sourcepoint optional onConsentReady event callback for GDPR is shown below. The variable consentedToAll gives the vendor grant status:
JSON response
1
consentedToAll: "true"
Copied!
Last modified 23d ago