chriskyfung / amp-affiliately-jekyll-theme

An AMP-Ready Jekyll Blog Theme
https://chriskyfung.github.io/amp-affiliately-jekyll-theme/
MIT License
19 stars 12 forks source link

✨ Feat (UI): Implement Granular Consent UI for GDPR Compliance 🍪 #44

Open chriskyfung opened 10 months ago

chriskyfung commented 10 months ago

Title: Implement Granular Consent UI for GDPR Compliance

Description

The current AMP-ready Jekyll theme includes services that utilize cookies to store user data. To ensure compliance with the General Data Protection Regulation (GDPR), we need to implement a granular consent UI that allows users to control their cookies on a per-purpose basis.

Problem

The theme does not currently provide users with a way to opt in or out of specific cookie purposes, which could result in non-compliance with GDPR requirements.

Proposed Solution

We propose implementing a Consent UI that includes the following features:

Possible Implementations

One possible implementation could involve using a third-party consent management platform (CMP) that is AMP-compatible. CMPs provide a range of features out-of-the-box, including granular consent options, data collection, and reporting.

Another approach could be to develop a custom Consent UI using AMP elements. This would require more development effort but could provide greater control over the UI's design and functionality.

Benefits

Implementing a granular Consent UI will provide the following benefits:

Timeline

This feature should be prioritized and completed within the next sprint.

Assignee

To be assigned after discussion and review of proposed implementations.

Additional Notes

Development of a custom Consent UI using AMP elements

Objectives

Tasks

Phase 1: Design and Development

Phase 2: Integration and Testing

Phase 3: Deployment and Maintenance

Additional Tasks

chriskyfung commented 8 months ago

Proposed Consent UI Design

To collect cookie consent on AMP pages, we intend to incorporate the following AMP components in the design of the Consent UI:

To gather cookie consent on AMP pages, it's necessary to utilize the <amp-consent> element along with the data-block-on-consent or data-block-on-consent-purposes attribute.

Our Consent UI is designed to manage the following specific user interactions:

The <amp-bind>, <amp-consent>, and <amp-script> elements play crucial roles in the Consent UI design. Here's how they function:

  1. <amp-bind>: This AMP component allows elements on the page to have their attributes, CSS classes, and text contents dynamically changed in response to user actions or data changes. In the context of the Consent UI, <amp-bind> is used to manage the consent states for different types of cookies (essential, functional, analytics, advertising). It can dynamically show or hide certain UI elements based on the user's consent preferences.

  2. <amp-consent>: This is a key component for managing user consent. It provides the ability to show a customizable consent UI, and it handles user interactions with this UI. In the Consent UI design, <amp-consent> is used to set up the consent banner and the cookie preference modal. It also manages the post-consent UI, which includes a button that prompts the consent UI when clicked.

  3. <amp-script>: This AMP component allows custom JavaScript to be run on AMP pages. In the Consent UI, <amp-script> is used to load the stored consent states from the local storage and override the default values defined in the <amp-state>. This is crucial for maintaining the user's consent preferences across different browsing sessions.

The interaction between these elements is as follows:

References:

  1. https://amp.dev/documentation/components/amp-bind
  2. https://amp.dev/documentation/components/amp-consent
  3. https://amp.dev/documentation/components/amp-script
  4. https://www.iubenda.com/en/help/3182-cookie-consent-amp-pages
  5. https://onetrustprivacy.my.site.com/cpcustomers/s/article/UUID-94cf9b13-1998-d989-a5e0-d01a73a2e0a7?language=en_US
  6. https://www.iubenda.com/en/help/22135-cookie-solution-amp-wordpress
chriskyfung commented 8 months ago

Cookie Consent Samples

CodePen:

Glitch:

And more...:

chriskyfung commented 8 months ago

Some Known Issues of <amp-consent> Elements