__tcfapi function - getCustomVendorConsents

Sourcepoint has extended the functionality of the IAB's TCF API to offer your organization additional commands that can be used with the __tcfapi() function call. This provides a level of consistency and feature overlap between IAB TCF API and custom function integrations.

The getCustomVendorConsents command enables your organization to handle vendors that participate in the TCF API and custom vendors that do not participate in the TCF API.


Command

ThegetCustomVendorConsents command returns an object that contains information on IAB and custom vendors an end-user consents to, and the legitimate interest and consent purposes mapped to a vendor.

Your organization can call the command through the browser console or Javascript code on a webpage.

Browser console JavaScript

Enter the following command directly into the browser tools' console window.

__tcfapi('getCustomVendorConsents', 2, function(data, success) {console.log("getCustomVendorConsents response: ", data, " + ", success);});

Response

The response is a JSON object that contains the consent data and this is divided into four parts:

Schema Example
Attribute Type Value
consentedPurposes Array Lists the purposes that apply to the end-user
consentedVendors Array Lists the custom vendors in the vendor list that apply to the end-user
grants Object Lists the consented purposes for each vendor
legIntPurposes Array Lists the purposes that are listed as legitimate interest for all vendors

consentedPurposes schema Example

Every array element in the consentedPurposes array is an object that lists the purposes that apply to the end-user. The model for each object is as follows:

Key Type Value
_id String The purpose's Purpose ID
name String Purpose description as described in vendor list
index: {_id: "purpose id", name: "purpose description"}
consentedVendors schema Example

Every array element in the  consentedVendors array is an object that lists the custom vendors in the vendor list that apply to the end-user. The model for each object is as follows:

Key Type Value
_id String The custom vendor's Vendor ID
name String Custom vendor name as described in vendor list
vendorType String The vendor type, if the vendor is custom or affiliated to the IAB
index: {_id:"vendor id", name:"vendor name", vendorType:"vendor type"}
grants schema Example

Every property in the grants object is a vendor on your vendor list (identified by its vendor_id) and contains the applicable purposes and the consent status for that vendor. The model for each object is as follows:

Key Type Value
purposeGrants Object Contains all applicable purposes and whether consent was given from the end-user. See below
vendorGrant Boolean
  • true if end-user granted consent to all applicable purposes for the vendor 
  • false if end-user has not given consent to one or more applicable purposes for the vendor

The purposeGrants object contains all applicable purposes (identified by its purpose_id) for the vendor and whether consent was given from the end-user. The model for each object is as follows:

Key Type Value
purpose_id Boolean
  • true if the end-user has granted consent for the purpose
  • false if the end-user has not granted consent for the purpose
vendor_id: {vendorGrant: status, purposeGrants: { "purpose_id 1": status, "purpose_id 2": status, ...}}
legIntPurposes schema Example

Every array element in the LegIntPurposes array is an object that lists a purpose who uses legitimate interest as a legal basis for at least one vendor on your vendor list. The model for each object is as follows:

Key Type Value
_id String The purpose's Purpose ID
name String Purpose description as described in vendor list
index: {_id: "purpose id", name: "purpose description"}
Was this article helpful?
0 out of 0 found this helpful