Functionality
The function enableRejectChoice
enables an additional button in AdConsent GDPR GUI main page, which allows the user to perform a full opt-out without the need to go to Customize Choices and then Save. This option is currently being required in some user countries, so it can be enabled or disabled globally, but also in a per-country basis. Given this is an option that can impact earnings on associated products like AdEngine, this is an option that is disabled by default.
Syntax
function adconsent.gdpr()
argument name | type | optional | value | description |
---|---|---|---|---|
command | string |
| Sets a customizable title in the CMP GUI first layer. | |
parameter | boolean or Array(string) |
| A boolean to set globally on or off, or an array with the country codes where it should be enabled | |
callback | function | ✔️ |
| The callback function that is called with the function call result. |
Description
Enabling the reject choice will create an additional button in the GDPR UI first screen, which allows the user to perform a full opt-out right from the first screen of AdConsent. The general appearance of the UI will be much like the one below:
Scope
The function must be called before AdConsent shows the GUI. Calls after AdConsent has shown the GUI will be ignored.
Examples
Setting the CMP GUI to always show the reject button
adconsent.gdpr('enableRejectChoice', true);
Setting the CMP GUI to always hide the reject button
adconsent.gdpr('enableRejectChoice', false);
Setting the CMP GUI to show the reject button for Portugal, Spain and Germany users
adconsent.gdpr(''enableRejectChoice', ['pt', 'es', 'de']);