How it works
In this section you will find the JavaScript commands allowing you to interact with the CMP on your site.
Sirdata CMP provides you with a list of standard commands documented in the IAB Tech Lab CMP JavaScript API.
All the commands are executed through the API function __tcfapi
.
window.__tcfapi(command, version, callback, parameter);
The version
parameter is the TCF specification version (= 2).
PingReturn
{
gdprApplies: *Boolean*,
cmpLoaded: *Boolean*,
cmpStatus: *String*,
displayStatus: *String*,
apiVersion: '2.0',
cmpVersion: *Integer*,
cmpId: *Integer*,
gvlVersion: *Integer*,
tcfPolicyVersion: *Integer*
}
TCData
{
tcString: [base64url-encoded] *String*,
addtlConsent: *String*,
tcfPolicyVersion: *Integer*,
cmpId: *Integer*,
cmpVersion: *Integer*,
gdprApplies: *Boolean*,
evenStatus: *String*,
cmpStatus: *String*,
isServiceSpecific: *Boolean*,
useNonStandardStacks: *Boolean*,
publisherCC: *String*,
purposeOneTreatment: *Boolean*,
outOfBand: {
allowedVendors: {
*vendorId*: *Boolean*,
?
},
disclosedVendors: {
*vendorId*: *Boolean*,
?
}
},
purpose: {
consents: {
*purposeId*: *Boolean*,
?
},
legitimateInterests: {
*purposeId*: *Boolean*,
?
}
},
vendor: {
consents: {
*vendorId* : *Boolean*,
?
},
legitimateInterests: {
*vendorId* : *Boolean*,
?
}
},
specialFeatureOptins: {
*specialFeatureId*: *Boolean*,
?
},
publisher: {
consents: {
*purposeId*: *Boolean*,
?
},
legitimateInterests: {
*purposeId*: *Boolean*,
?
},
customPurpose: {
consents: {
*customPurposeId*: *Boolean*,
?
},
legitimateInterests: {
*customPurposeId*: *Boolean*,
?
}
},
restrictions: {
*purposeId*: {
*vendorId* : *Integer*,
?
},
?
}
}
}
GlobalVendorList
{
gvlSpecificationVersion: *Integer*,
vendorListVersion: *Integer*,
tcfPolicyVersion: *Integer*,
lastUpdated: *String*,
purposes: {
*purposeId*: {
id: *Integer*,
name: *String*,
description: *String*,
descriptionLegal: *String*,
},
?
},
specialPurposes: {
*specialPurposeId*: {
id: *Integer*,
name: *String*,
description: *String*,
descriptionLegal: *String*,
},
?
},
features: {
*featureId*: {
id: *Integer*,
name: *String*,
description: *String*,
descriptionLegal: *String*,
},
?
},
specialFeatures: {
*specialFeatureId*: {
id: *Integer*,
name: *String*,
description: *String*,
descriptionLegal: *String*,
},
?
},
stacks: {
*stackId*: {
id: *Integer*,
name: *String*,
description: *String*,
purposes: [
*Integer*,
?
],
specialFeatures: [
*Integer*,
?
],
},
?
},
vendors: {
*vendorId*: {
{
id: *Integer*,
name: *String*,
purposes: [
*Integer*,
?
],
legIntPurposes: [
*Integer*,
?
],
flexiblePurposes: [
*Integer*,
?
],
specialPurposes: [
*Integer*,
?
],
features: [
*Integer*,
?
],
specialFeatures: [
*Integer*,
?
],
policyUrl: *String*,
usesCookies: *Boolean*,
cookieMaxAgeSeconds: *Integer*,
usesNonCookieAccess: *Boolean*,
deviceStorageDisclosureUrl: *String*
},
?
}
}
Events
You will find in the table below the list of events that can be triggered by the CMP:
Dernière mise à jour