Manage consent programmatically
This chapter will teach you how to manage the consents of our cookie widget programmatically.
Where are the consents stored?
Access to the consent service
<script>
window.dastra = window.dastra || [];
window.dastra.push(['cookieReady',function(manager)
{console.log(manager.consent)}]);
</script>List of methods available in the consent manager
Get the list of user's consents (getAllConsents)
Query consents by category (getPurposeConsent/setPurposeConsent)
Category
Label
Handle consents by service

Example of use
Reacting to consent updates (the dastra:consents:updated event)
dastra:consents:updated event)Last updated
Was this helpful?