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

The postRejectAll command is an on-page opt-out mechanism that will reject all purposes and vendors for the GDPR TCF vendor list associated with the property. By attaching the command to the onclick event of a page element, your organization can provide end-users with a one-click solution that allows them to easily revoke consent. 

  Note: The postRejectAll command is available for implementations on website properties utilizing Sourcepoint's GDPR TCF v2 legacy script (2.x.x) and Sourcepoint's multi-campaign script (4.x.x).

Use case


To comply with certain local DPA regulations regarding the PUR model, your organization needs to implement a button that allows an end-user to revoke consent as easily as it is given. End-users who visit your website property can give consent with one click and you need to permanently display a button that allows consent to be revoked with also one click. 


Implement postRejectAll command

In order to implement the postRejectAll command on your website property, you will need to:

  1. Implement a button or link on your website property with an element ID. The suggested element ID is "postRejectAll".
  2. Create a function that executes the postRejectAll command
  3. Use the document.getElementbyId method to return the button or link ID and call your function for an onclick event.
postRejectAll command HTML JavaScript
__tcfapi('postRejectAll', 2, function (postRejectAllResponse, success) {
    console.log("postRejectAllResponse: ", postRejectAllResponse);
    console.log('postRejectAllResponse was successful: ' + success)


In addition to any custom code you might implement when your function executes, a successful reject all action will return truefor the success parameter.


Was this article helpful?
0 out of 0 found this helpful