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.

JavaScript code 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);
  

 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 true if all purposes for a vendor apply to an end-user. Status is false if one or more purposes for a vendor denies consent for one or more purposes.
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', ccpa: { }, 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"
Was this article helpful?
0 out of 0 found this helpful