Consent Object
Description of the Consent Object format that is used by the onsite API to receive and update consent.
The Consent Object is a standardized way to represent consent throughout all methods of the onsite JavaScript API (similar to the IAB TCF consent string). The object holds a meta
property that includes metadata like the validity of the cookie and a consent
property that holds that current consent settings stored on the browser.The onsite API and Consent Object is the official way to access the consent settings of Commanders Act CMP with JavaScript. The direct usage of the Consent Cookie is deprecated.
Example Consent Object
Meta Properties
The meta
property includes metadata and context for the consent that was provided on a browser.
Property | Description | Type |
| Version of the Consent Object. | String |
| Version of the IAB TCF consent. | String |
| Commanders Act site id associated to the consent. | String |
| Banner id associated to the consent. | String |
| Banner version associated to the consent. | String |
| Id of the consent stored in the | String |
| Timestamp when the consent was provided (UNIX Epoch in Milliseconds). | Number |
| Timestamp when the consent was updated the last time (UNIX Epoch in Milliseconds). | Number |
| Timestamp when the consent will expire (UNIX Epoch in Milliseconds). | Number |
Consent Properties
The consent property includes detailed information about the consent provided on the browser.
Property | Description |
| Global status of the consent that can have one of the following values: all-on: All consent categories have been accepted.all-off: All consent categories have been refused (except blocked on).mixed: Some consent categories have been refused.unset: No consent has been provided yet. |
| Status of an individual category:on: Consent was provided.off: Consent was rejected.unset: No consent has been provided yet (In case neutral button position is configured it will switch to neutral button position for this category). |
| The property was set to blocked on and the status is always on. |
| Status of an individual vendor:on: Consent was provided.off: Consent was rejected.unset: No consent has been provided yet (In case neutral button position is configured it will switch to neutral button position for this vendor). |
Category and Vendor IDs are prefixed with an identifier in case they are managed by a consent framework.
Framework | Prefix |
| IAB TCF 2 framework. Special features are additionally prefixed with |
| Google's Additional Consent Mode vendors. |
Last updated