-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: change from delayed
flow to include consent
#376
base: main
Are you sure you want to change the base?
Conversation
|
delayed
flow to include consent
scripts/scripts.js
Outdated
if (consentStatus === 'declineAll') return false; | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (consentStatus === 'declineAll') return false; | |
return true; | |
if (consentStatus === 'acceptAll') return true; | |
return false; |
scripts/scripts.js
Outdated
if (consentStatus !== null) return mapStatus(consentStatus); | ||
return new Promise((resolve) => { | ||
// display consent banner | ||
document.addEventListener('aem:changeconsent', (e) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
document.addEventListener('aem:changeconsent', (e) => { | |
document.addEventListener('aem:consentchange', (e) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, who fires this event ? Adding an event listener in a check
method is not a good practice. If I call the checkConsent
method multiple times, the document will have multiple similar listeners.
scripts/consent.js
Outdated
/* main consent handler */ | ||
export default async function handleConsent() { | ||
const mapStatus = (consentStatus) => { | ||
if (consentStatus === 'declineAll') return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return consentStatus !== 'declineAll';
? Or is that unclear?
changing the flow of loading marketing tech based on a conditions / events such as consent
https://marketing-tech--aem-boilerplate--adobe.aem.page/