__tcfapi getVendorPurposeMapping API

The __tcfapi getVendorPurposeMapping method enables your organization to retrieve a "map" that lists out the vendors, purposes, and legal bases for a GDPR TCF v2 Vendor List on a specific property.

Use Case: Quickly identify which vendors are using a specific purpose in order to perform bulk operations such as __tcfapi postCustomConsent.

Input the following into the console tab of a property to retrieve the map:

__tcfapi('getVendorPurposeMapping', 2, (vendorPurposeMapping, success) => { console.log(vendorPurposeMapping); });

The data object returned will list the vendors on the GDPR TCF v2 Vendor List (identified by their vendorId).

1: {vendorId: "5e716f1d9a0b5040d575080e", categories: Array(10)}
2: {vendorId: "5e71764c69966540e4554f02", categories: Array(10)}
3: {vendorId: "5e7e1298b8e05c4854221be9", categories: Array(2)}
4: {vendorId: "5e542b3a4cd8884eb41b5a80", categories: Array(1)}
5: {vendorId: "5e7ced57b8e05c5a7d171cda", categories: Array(5)}
6: {vendorId: "5e37fc3e56a5e60e003a7124", categories: Array(9)}

Expand an object to view the categories/purposes (identified by the purpose id, _id) for the vendor and the legal basis used by the vendor for each category/purpose.

categories: Array(10)
0: {_id: "5ef0a6d9638b030b01348201", type: "CONSENT"}
1: {_id: "5ef0a6d9638b030b01348215", type: "LEGITIMATE_INTEREST"}
2: {_id: "5ef0a6d9638b030b0134822f", type: "LEGITIMATE_INTEREST"}
3: {_id: "5ef0a6d9638b030b01348242", type: "LEGITIMATE_INTEREST"}
4: {_id: "5ef0a6d9638b030b01348257", type: "LEGITIMATE_INTEREST"}
5: {_id: "5ef0a6d9638b030b01348263", type: "LEGITIMATE_INTEREST"}
6: {_id: "5ef0a6d9638b030b01348272", type: "LEGITIMATE_INTEREST"}
7: {_id: "5ef0a6d9638b030b01348280", type: "LEGITIMATE_INTEREST"}
8: {_id: "5ef0a6d9638b030b01348292", type: "LEGITIMATE_INTEREST"}
9: {_id: "5f4eba7b3914353101e05a04", type: "DISCLOSURE_ONLY"}
length: 10
__proto__: Array(0)
vendorId: "5e68dbdd69e7a93e0b259030"
__proto__: Object