Consent Management

Implement your own cookie consent solution for your Flipbook.

While Flipbooks does have built-in cookie consent management, we understand that some may prefer to use either their own system or a 3rd party system. On this page we have gathered useful code snippets that can assist in implementing custom cookie consent solutions using the v2 Flipbook JavaScript API.

Note:

Prior to implementing custom cookie solutions, please make sure that your Flipbook cookie policy is set to ‘Integration’.

Note:

When using a 3rd party cookie solution, please make sure that the scripts for the solution are fully loaded before you reference it / use it inside any of the Consent Management API methods. In order to avoid issues, we also recommend that you do not load the 3rd party script asynchronously (i.e. using the async keyword in the tag).

async function iPaperInit() {
    await iPaperAPI.getCookieConsent();
}

This will return an object that represents the current cookie consent given, like the example below:

{
    allowAdvertisingCookies: true
    allowFunctionalCookies: true
    allowPerformanceCookies: true
    allowStrictlyNecessaryCookies: true
    hasPreviousCookieConsent: true
}

When setting/updating cookie consent, you can set whether or not (true/false) to allow 3 categories of cookies: Performance, Functional, and Advertising.

function iPaperInit() {
    iPaperAPI.updateCookieConsent({ 
        allowPerformanceCookies: true, 
        allowFunctionalCookies: true, 
        allowAdvertisingCookies: true
    });
}

Using the code below you can define a callback function that will run when the cookie consent is updated/changed:

function iPaperInit() {
    iPaperAPI.onCookieConsentUpdate = function(newConsent) {
        // YOUR CODE GOES HERE
    };
}

Using the code below you can define a callback function that runs when the “Cookie Policy” button/link in the Flipbook viewer header is clicked:

function iPaperInit() {
    iPaperAPI.onCookieConsentShown = function() {
        // YOUR CODE GOES HERE
    }
}

Please note that by default clicking the “Cookie Policy” button will not do anything if the callback function has not been defined.

Last updated