Using the __uspapi('getCustomVendorRejects') function for CCPA Non-IAB Vendors

Overview

Sourcepoint provides a client-side JavaScript API to help you understand which vendors a user has executed a DO NOT SELL request against. The data returned from the API is a list of categories and vendors to which the user has rejected consent. It also returns a boolean value as to whether CCPA applies to this user based on the account set up.

The API is an extension to the __uspapi() function called getCustomVendorRejects. The function format is __uspapi('getCustomVendorRejects',1, callback_function);. The callback function gets two pieces of data passed to it a JSON object containing the data used to process non-IAB consent and boolean value for whether the request was successful or not.

The example function below prints the JSON object to the developer’s console window.

__uspapi('getCustomVendorRejects',1,function(uspData,success){console.log(uspData)});

An example of the data returned from this API is below. It includes each name and ID for each category and vendor the user has rejected. This data can then be parsed and the appropriate measures can be taken.

{
"rejectedCategories": [{
"_id": "5ede9a62ffbdcd235d9923f5",
"name": "Advertising"
},
{
"_id": "5ede9a62ffbdcd235d9923f6",
"name": "Marketing"
},
{
"_id": "5ede9a62ffbdcd235d9923f7",
"name": "Functional"
}
],
"rejectedVendors": [{
"_id": "5e0b72542375261eb9485381",
"name": "Amazon Advertising",
"vendorType": "CUSTOM"
},
{
"_id": "5e1f23881fef950a5ecec0c3",
"name": "Disqus, Inc.",
"vendorType": "CUSTOM"
},
{
"_id": "5e2a0826fcf931176b1bf933",
"name": "Facebook",
"vendorType": "CUSTOM"
},
{
"_id": "5e2a0826fcf9316bde75b543",
"name": "Twitter, Inc.",
"vendorType": "CUSTOM"
}],
"ccpaApplies": true
}