getVendorPurposeMapping command (non-TCF)

Sourcepoint offers your organization additional commands that can be used for GDPR non-TCF web implementation. This provides a level of consistency and feature overlap between IAB TCF v2 and non-TCF integrations.

The getVendorPurposeMapping command enables your organization to handle vendors participating in non-TCF campaigns.

getVendorPurposeMapping command

The command returns a JSON object that contains information on the purposes and corresponding legal basis attributed to each vendor and their legal basis. The format of the getVendorPurposeMapping command is as follows:Browser console command

Browser console command
Server-side script (PHP example)
Browser console command
//Input into browser console to receive response
window._sp_.gdpr.getVendorPurposeMapping((data, success) => { console.log(data,success); });
Server-side script (PHP example)

Your organization could use a server side script using code similar to the following PHP example to retrieve the vendor purpose mapping. You will need to provide the correct values for site id in the script.

$site_id = "XXXXX";
$api_endpoint = "https://sourcepoint.mgr.consensu.org/tcfv2/vendor-list/vendor-purpose-mapping?siteId=".$site_id;
$handle = curl_init($api_endpoint);
$fileHandle = fopen("vendor_purpose_mapping.json", "w");
/* If you encounter an 'SSL certificate problem: unable to get local issuer certificate' then enable the following two lines */
/* This is NOT recommended as a solution and should only be used as a quick and temporary fix */
//curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, 0);
//curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($handle, CURLOPT_FILE, $fileHandle);
curl_exec($handle);
curl_close($handle);
fclose($fileHandle);

getVendorPurposeMapping response

The response contains the consent data that maps the purposes and legal basis to the vendor. The categories section lists the purpose ids for each vendor with their legal basis type.

Parameter

Description

_id

Purpose ID

type

The legal basis set for this purpose - consent, legitimate interest, not allowed, disclosure only

vendorId

Vendor ID

length

Number of purposes attached to this vendor

0:
categories:
0: {_id: "5ff4ca88f485275018dd8b9e", type: "CONSENT"}
1: {_id: "5ff4ca88f485275018dd8b99", type: "CONSENT"}
2: {_id: "5ff4ca88f485275018dd8ba3", type: "CONSENT"}
vendorId: "5e7ced57b8e05c47e418b73c"
length: 3
1:
categories:
0: {_id: "5ff4ca88f485275018dd8b9e", type: "CONSENT"}
1: {_id: "5ff4ca88f485275018dd8b99", type: "LEGITIMATE_INTEREST"}
2: {_id: "5ff4ca88f485275018dd8ba3", type: "CONSENT"}
vendorId: "5fd78083fc186126cb9fabad"
length: 3