OneTrust
Setting and updating iPaper Consent
const instance = iPaperJsApi(3);function setIpaperConsent(activeConsentGroups) {
/* Get consent for each category:
These are retrieved using their OneTrust CustomGroupId.
By running/using OnetrustActiveGroups in the console, you can see which
categories are currently accepted from the cookie banner and thereby find
out exactly what these CustomGroupIds are */
const performanceCustomGroupId = {{ INSERT VALUE HERE }}; // Typically looks like 'C0001'
const functionalCustomGroupId = {{ INSERT VALUE HERE }}; // Typically looks like 'C0001'
const advertisingCustomGroupId = {{ INSERT VALUE HERE }}; // Typically looks like 'C0001'
// Once you know the CustomGroupIds, check each of them to see if they are active
const allowPerformanceCookies = activeConsentGroups.includes(performanceCustomGroupId) ? true : false;
const allowFunctionalCookies = activeConsentGroups.includes(functionalCustomGroupId) ? true : false;
const allowAdvertisingCookies = activeConsentGroups.includes(advertisingCustomGroupId) ? true : false;
// Set iPaper consent to match the above
instance.consent.set({
allowPerformanceCookies,
allowFunctionalCookies,
allowAdvertisingCookies,
});
}Showing the cookie banner
Last updated