getVendorPurposeMapping command (GDPR TCF)

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 additional functionality provides a level of consistency and feature overlap between IAB TCF API and custom function integrations.

Your organization could use a server side script using code similar to a PHP example shown here to retrieve the vendor purpose mapping.

The getVendorPurposeMapping enables your organization to retrieve a list of vendors and map their purposes and legal bases for a specific property.

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

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 Code example Server-side script (PHP example)
//Input into browser console to receive response
__tcfapi('getVendorPurposeMapping', 2, (vendorPurposeMapping, success) => { console.log(vendorPurposeMapping); });

getVendorPurposeMapping response

The response contains the consent data that maps the purposes and legal basis to the vendor. This is described next.

Parameter description

The categories section lists the purpose ids for each vendor with their legal basis type. The purposes are listed as follows:

Parameter Description
_id Purpose ID
type The legal basis set for this purpose - consent, legitimate interest, not allowed, disclosure only
vendorId Vendor ID
      0: {_id: "6011ea75c5d9c787531b3ecf", type: "CONSENT"}
      1: {_id: "6011ea75c5d9c787531b3ed6", type: "CONSENT"}
      2: {_id: "6011ea75c5d9c787531b3ede", type: "CONSENT"}
      3: {_id: "6011ea75c5d9c787531b3ee6", type: "CONSENT"}    
      4: {_id: "6011ea75c5d9c787531b3eed", type: "CONSENT"}
      5: {_id: "6011ea75c5d9c787531b3ef5", type: "CONSENT"}
      6: {_id: "6011ea75c5d9c787531b3efd", type: "DISCLOSURE_ONLY"}
      7: {_id: "6011ea75c5d9c787531b3f05", type: "CONSENT"}
      8: {_id: "6011ea75c5d9c787531b3f0e", type: "CONSENT"}
      9: {_id: "6011ea75c5d9c787531b3f18", type: "LEGITIMATE_INTEREST"}
   vendorId: "5e7ced57b8e05c47e418b73c"
      0: {_id: "6011ea75c5d9c787531b3ecf", type: "NOT_ALLOWED"}
      1: {_id: "6011ea75c5d9c787531b3ed6", type: "NOT_ALLOWED"}
      2: {_id: "6011ea75c5d9c787531b3efd", type: "CONSENT"}
      3: {_id: "6011ea75c5d9c787531b3f05", type: "CONSENT"}
   vendorId: "5e37fc3e56a5e6614776722f"
Was this article helpful?
0 out of 0 found this helpful