ADNUNTIUS
Search…
Consents API

Running on pageload

If you would like to run any of the below functions on page load, make sure to wrap it with the adn.calls function:
1
// Example adn.calls wrapper for pageload
2
3
<script src="https://cdn.adnuntius.com/adn.js" async></script>
4
<script>
5
window.adn = window.adn || {};
6
adn.calls = adn.calls;
7
8
adn.calls.push(function () {
9
adn.consents.init("messageBox");
10
});
11
</script>
Copied!

Trigger the popup

In order to trigger the popup you can use this function:
1
adn.consents.init("{POSITION}");
Copied!
The init function will offer two positions listed below, replace {POSITION} in the text above in order to trigger the appropriate popup:
Value
Action
messageBox
Will trigger a box in the bottom corner of the page. Example below
overlay
Will trigger an overlay over the page. Example below

Save all purposes

1
adn.consents.saveAll({BOOLEAN})
Copied!
Value
Action
true
Sets all purposes and vendors to accepted.
false
Sets all purposes and vendors to rejected.

Callback for Save button

1
window.adn = window.adn || { calls: [] };
2
adn.callbacks = {
3
consentSave: function (consentData) {
4
console.log(consentData)
5
}
6
}
Copied!
The consentData variable will return this object:
1
{
2
cid: "d5c7b351-...",
3
given: true,
4
legIntPurposes: ["all"],
5
purposes: (10) [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
6
specialFeatures: ["all"],
7
stack: false,
8
tc: "CO7N7b-O7N7b-...",
9
time: 1602589260227,
10
vendors: ["all"]
11
}
Copied!
Last modified 11mo ago