Consent
Through the JS API, you can manage the cookie consent set for the flipbook. This is particularly useful if you want to implement your own cookie solution or a 3rd party one.
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 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).
Commands
get
get
Retrieves the active/current cookie consent of a Flipbook.
The command will return an object with the following properties:
Property | Type | Description |
---|---|---|
|
| Are performance cookies enabled/allowed |
|
| Are functional cookies enabled/allowed |
|
| Are advertising cookies enabled/allowed |
|
| Are strictly necessary cookies enabled/allowed (always |
|
| Has user previously given explicit consent |
set
set
This command allows you to set/update the cookie consent for a flipbook. The command requires one argument, consisting of the properties below:
Property | Type | Description |
---|---|---|
|
| Should performance cookies be allowed |
|
| Should functional cookies be allowed |
|
| Should advertising cookies be allowed |
Optionally, you can add a callback to this command which will run once the consent has been sucesfully updated:
The callback contains a value/result of what the cookie consent was sucessfully updated to:
Property | Type | Description |
---|---|---|
|
| Are performance cookies enabled/allowed |
|
| Are functional cookies enabled/allowed |
|
| Are advertising cookies enabled/allowed |
|
| Are strictly necessary cookies enabled/allowed (always |
|
| Has user previously given explicit consent |
show
show
If you are using iPaper's built-in basic cookie banner, you can toggle the banner to be shown via this command.
Events
onChange
onChange
This subscription will trigger every time the cookie consent is changed/updated.
The callback contains a value/result with the following properties:
Property | Type | Description |
---|---|---|
|
| Are performance cookies enabled/allowed |
|
| Are functional cookies enabled/allowed |
|
| Are advertising cookies enabled/allowed |
|
| Are strictly necessary cookies enabled/allowed (always |
|
| Has user previously given explicit consent |
onShow
onShow
By listening to this event you can define a callback function that runs when either the show
API command has been run, or when the “Cookie Policy” button/link in the Flipbook viewer header is clicked. This could for example be used to trigger showing a 3rd party cookie banner.
Last updated