Frontend manager
malutanpetronel opened this issue · 2 comments
Description
Is there any $manager->canSet('thid_party_scope_name'); in javascript or I should
manually iterate all element gdpr_cookie_bar_option_functional... gdpr_cookie_bar_option_ga or _whatever and see if the checkbox is checked in order to follow the user preferences regarding some scopes and set or delete cookies ?
Hi there and sorry for the late response.
There is currently no simplified way to check if the cookie can be set through one of the tools.
However, the gdpr_cookie.js
file implements these checks already. So if you don't want any other logic implemented than to check if a cookie can be set or not, I suggest using this. If you want to implement some custom logic to this, you can always use the following snippet when implementing the gdpr_compliance.js
file:
if (complianceTool.getAllowed().indexOf(scope) > -1){
// Your logic here
}
The getAllowed
method will retrieve a list of cookies that are allowed to be set.
Thank you and no problem for late answer.
Sometimes having more time or patience to meditate about something you see for your first time, is the key for better understanding.