setPrivacyPolicy

Functionality

The setPrivacyPolicy function is used to set the publisher privacy policy link. AdConsent requires a link to the publisher site's privacy policy to be displayed in the AdConsent user interface.
In particular, a common privacy policy link or a specific link for each consent law/zone can be provided. This is achieved through the setPrivacyPolicy function in AdConsent, which can be called through adconsent() global object (so that link can be applied to all consent zones), or through the adconsent.gdpr() and adconsent.ccpa() interfaces, in case there are specific privacy policy pages for each consent law.
AdConsent also doesn't automatically trigger the CMP GUI when in the presence of the privacy policy page, as long as it is correctly configured in AdConsent.

Syntax

function adconsent()
function adconsent.gdpr()
function adconsent.ccpa()

argument name

type

optional

value

description

argument name

type

optional

value

description

command

string

 

'setPrivacyPolicy'

 

parameter

string

✔️

e.g.: '//mysite.com/privacy.html'

The publisher site privacy policy page.

callback

function

✔️

function(message:JSON, success:boolean)

The callback function that is called with the function call result.

parameter

The publisher site's privacy policy page link to be shown in the AdConsent user interface.

Description

The CMP for each consent zone has an area in the GUI where the user can access the publisher’s privacy policy page for more information regarding this matter. This means the privacy policy page should be correctly configured in order to provide this feature in the GUI. In case the privacy policy has different sections or different pages altogether for each specific zone, a different link for each consent zone can be provided, using the specific interfaces adconsent.gdpr() and adconsent.ccpa().
If the user is already on the privacy policy page, having this setting will prevent the CMP popup from automatically opening on the page (but not for the other pages), which is the recommended behavior. Please check showGUI command for insights on how to manually open the CMP GUI on these pages.

Scope

The function must be called before AdConsent shows the GUI. Calls after AdConsent has shown the GUI will be ignored.

Examples

Setting a global privacy policy page 'https://mysite.com/privacy.html' across all consent zones

adconsent('setPrivacyPolicy', 'https://mysite.com/privacy.html');

Setting different privacy policy pages for GDPR and CCPA

adconsent.gdpr('setPrivacyPolicy', 'https://mysite.com/gdpr/privacy.html'); adconsent.ccpa('setPrivacyPolicy', 'https://mysite.com/ccpa/privacy.html');