ADNUNTIUS
Search…
TCF API
The TCF framework have a helper function that will fetch the consents given by a user. you can use it by this code snippet below:
1
__tcfapi('getTCData', 2, function (tcData, success) {
2
if (success) {
3
console.log(tcData)
4
} else {
5
console.log('bummer dude')
6
}
7
});
Copied!
The tcData variable will return an object that contains this data:
1
{
2
cmpId: 1000,
3
cmpVersion: 2,
4
gdprApplies: true,
5
purpose: {
6
consents: { 1: true, 2: true, 3: true, 4: true ... }
7
legitimateInterests: { 1: true, 2: true, 3: true ...}
8
}
9
specialFeatureOptins:{ 1: true, 2: true ... }
10
tcString: "CO7N7b-O7N7b-DrACAENAtCAAP_AA...",
11
tcfPolicyVersion: 2,
12
useNonStandardStacks: false,
13
vendor: {
14
consents: {1: true, 2: true, 4: true, 6: true ... }
15
legitimateInterests: {1: true ... }
16
}
17
}
Copied!
Last modified 1yr ago
Copy link