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 standardised 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 TrustCommander with JavaScript. The direct usage of the Consent Cookie is deprecated.

Example Consent Object

1
{
2
meta: {
3
version: "1.0",
4
tcfPolicyVersion: "2",
5
siteId: "1234",
6
bannerId: "12",
7
bannerVersion: "50",
8
consentId: "183049723840253",
9
dateCreated: 1614174067000,
10
dateUpdated: 1614185078030,
11
dateExpires: 1614236789942
12
},
13
consent: {
14
status: "all-on|all-off|mixed|unset",
15
categories: {
16
"1": {
17
status: "on",
18
required: true
19
},
20
"2": {
21
status: "on|off|unset"
22
},
23
"tcf2_1": {
24
status: "on|off|unset"
25
},
26
"tcf2_2": {
27
status: "on|off|unset",
28
legIntStatus: "on|off|unset"
29
},
30
"tcf2_sf_1": {
31
status: "on|off|unset"
32
}
33
},
34
vendors: {
35
"1": {
36
status: "on|off|unset"
37
},
38
"tcf2_1": {
39
status: "on|off|unset"
40
},
41
"tcf2_2": {
42
status: "on|off|unset",
43
legIntStatus: "on|off|unset"
44
},
45
"acm_1": {
46
status: "on|off|unset"
47
}
48
}
49
}
50
}
Copied!

Meta Properties

The meta property includes metadata and context for the consent that was provided on a browser.
Property
Description
Type
meta.version
Version of the Consent Object.
String
meta.tcfPolicyVersion
Version of the IAB TCF consent.
String
meta.siteId
Commanders Act site id associated to the consent.
String
meta.bannerId
Banner id associated to the consent.
String
meta.bannerVersion
Banner version associated to the consent.
String
meta.consentId
Id of the consent stored in the TCPID cookie.
String
meta.dateCreated
Timestamp when the consent was provided (UNIX Epoch in Milliseconds).
Number
meta.dateUpdated
Timestamp when the consent was updated the last time (UNIX Epoch in Milliseconds).
Number
meta.dateExpires
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
consent.status
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.
consent.categories[category_id].status
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).
category_id is the category id configured under TRUST > Categories & Tags.
consent.categories[category_id].required
The property was set to blocked on and the status is always on.
consent.vendors[vendor_id].status
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).
vendor_id is the vendor id configured under TRUST > Categories & Tags.
Category and Vendor IDs are prefixed with an identifier in case they are managed by a consent framework.
Framework
Prefix
tcf2_
IAB TCF 2 framework. Special features are additionally prefixed with sf_
acm_
Google's Additional Consent Mode vendors.
Last modified 8mo ago