This event serves retrocompatibility if you're migrating from V2. If you're not migrating from V2, use the UC_CONSENT event.
Usercentrics provides Data Layer and Window events that specifically fire on consent changes.
You can check the contents of the dataLayer by using
window.dataLayer
Below the structure of the consent_status is represented:
{
"action": "onInitialPageLoad",
"event": "consent_status",
"type": "EXPLICIT",
"Service One": true,
"Usercentrics Consent Management Platform": true,
"Service Two": false,
"ucCategory": {
"essential": true,
"functional": false,
"marketing": null,
},
(...)
}Property | Description |
|---|---|
action | The action that triggered the event |
event | Name of the event ( |
type | Type of the event |
ucCategory | Object containing the identifier of all the categories and their consent status |
| Entry that contains the status of the service |
action
The action that triggered the event. Below are all the possible values for this property:
Value | Description |
|---|---|
onAcceptAllServices | Triggered once you click “Accept All” |
onDenyAllServices | Triggered once you click “Deny All” |
onEssentialChange | |
onInitialPageLoad | Triggered on page load |
onNonEURegion | |
onSessionRestored | Triggered in one of these three situations:
|
onTcfStringChange | |
onUpdateServices | Triggered once you edit a specific set of services or a single service and these choices are saved. |
onMobileSessionRestore |
type
Type of the event. Below are all the possible values for this property:
Value | Description |
|---|---|
| When the user didn't interact with the banner |
| When the user actively gives any type of consent |
ucCategory
Object containing the identifier of all the categories and their consent status. The consent status in this object can either be:
Value | Description |
|---|---|
| If all services belonging to this category have the state |
| If all services belonging to this category have the state |
| If services belonging to this category have mixed consent states: e.g. Marketing: null if one service is false while other services in this category are true |