showGUI
- 1 Functionality
- 2 Syntax
- 3 Description
- 3.1 Scope
- 4 Example
Functionality
Every existing consent law contemplates the possibility of the user changing his mind, thus changing the given consent. This means that the GUI resurface needs to be possible, which means AdConsent needs a way to manually open the GUI. This is achieved through the showGUI
function in AdConsent, which can be called through adconsent
global object.
Syntax
function adconsent()
argument name | type | optional | value | description |
---|---|---|---|---|
command | string | Â |
| Shows the CMP GUI. |
Description
When the users enter the publisher site from a specific consent zone, AdConsent reads existing consent or shows the user the CMP GUI to get first consent. Then, in the privacy policy page, there should be a button where the user can click to change his consent settings. This button should have its click event attached to the showGUI
function from AdConsent, thus opening the GUI for a resurface, allowing the user to change the given consent.
Opening the GUI for a specific consent region means:
GDPR applies to the user: GDPR GUI will be opened
CCPA applies to the user: CCPA GUI will be opened
No privacy policy applies to the user: The call will be ignored, no GUI opens
Please note that in the privacy policy page, as long as AdConsent is correctly configured using the setPrivacyPolicy command, the CMP GUI won't open automatically. This is due to the particular characteristics of the privacy policy page, where the user should be able to go and check the policies without the need to agree to anything.
Scope
This function can be called at any time of AdConsent execution time. However, calls before AdConsent check existing consent will be delayed until that point.
Example
Show the AdConsent GUI
This will open the consent region specific GUI. If a user is coming from a privacy region, for example, GDPR, it will open the GDPR GUI and allow the user to see and edit his previous choices.
If there is no privacy region available for this user, the call will be ignored.
adconsent('showGUI');
Â