Skip to content
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

Minimal non-intrusive Cookie consent block #50

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open

Conversation

chicharr
Copy link
Collaborator

@chicharr chicharr commented Feb 8, 2024

Test URLs:

Cookie Consent Block and consent management logic

The basics

  • This block displays a minimalistic non-intrusive cookie consent banner
  • Pages where cookie consent banner needs to be shown, must have a metadata property called cookie-consent, specifying the name of the cookie consent banner we want to show.
  • The content of the cookie consent banner is in a separate document normally in the path /cookie-consent/<name-of-the-consent-banner>
  • When a user selects their consent preferences, they are stored in the local storage.
  • The banner is only shown on page load if a user doesn't have preferences in the local storage.
  • When consent preferences are updated or read from the browser, a custom event is triggered. Martech loaders can listen to this events to decide what to load or not load, based on user preferences.

Cookie Consent Flow

Cookie Consent flow

Content of the banner

We offer 2 possibilities:

1. Simple consent banner

One simple text explaining that the website is using cookies. Buttons accept all, deny all can be added optionally.

Word document:
Contains a single section with the text, which can be styled, and metadata.

Metadata properties:

  • required cookies: List of cookie category codes that will be always active, regardless of what the user selects.
  • optional categories: List of cookie category codes that are optional, that will only be active if the user explicitly consents, by clicking accept all button.
  • buttons: comma-separated list. accepted values: accept-all , deny-all

Samples:

  • configuration:
    Screenshot 2024-02-16 at 16 31 43

  • banner displayed:

Screenshot 2024-02-16 at 16 34 45

2. Simple consent banner and categories details

Shows the simple consent banner as the previous one, but also offers a dialog which displays detailed information of each of the categories of cookies the website uses, and allows users to select individually each category.
By default only the minimalistic consent banner is shown, but users can click a "more information" button that will display the dialog.

Word document:

  • First section has the content of the simple content banner.
    In this case the only allowed metadata property is:
    buttons = accept_all | reject_all | more_info

  • The second and subsequent sections are only used in the detailed categories dialog.
    It expects a first intro section with some explanation text that is displayed on top of the dialog.
    The second and subsequent sections are considered to be cookie categories. And each of them need 2 metadata properties:
    code = code of the category that will be used by martech loaders
    optional = whether the category is optional or not.

Samples

  • configuration
    Screenshot 2024-02-16 at 17 00 58

  • dialog displayed
    Screenshot 2024-02-16 at 17 02 26

Copy link

aem-code-sync bot commented Feb 8, 2024

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

Copy link

aem-code-sync bot commented Feb 8, 2024

Page Scores Audits Google
/block-collection/cookie-consent-details-demo PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

Add availability to open cookie dialog from footer
@chicharr chicharr changed the title Cookie consent block with modal view (EU type) or minimal non-intrusive (US type) Minimal non-intrusive Cookie consent block Feb 16, 2024
@aem-code-sync aem-code-sync bot temporarily deployed to cookieconsent February 22, 2024 08:18 Inactive
Copy link
Contributor

@kptdobe kptdobe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diagram and the doc in the PR are great. I think this should be part of a README.md file in the block itself so that someone using the block has the doc too.

* chore: centralize vars

* fix: change link cursor

* chore: reduce code footprint

* chore: some doc

* chore: typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants