How to Capture Piwik Pro Current Consent Settings

Good day everyone, I have been trying to use the Javascript documentation on this page

https://developers.piwik.pro/en/latest/consent_manager/js_api/index.html#get-compliance-settings

and it’s not really returning the consent setting object values, maybe I didn’t get it right, can anyone help with the right javascript code. Thanks

You can use this piece of code:

ppms.cm.api('getComplianceSettings', function(settings){allConsents = settings.consents});
console.log(allConsents);

Here you can find some examples how to work with the API: Piwik PRO - Custom consent form example | Custom consent form example for Piwik PRO Consent Manager

1 Like

Thanks, Kuba it worked