Make the module aware of EU Cookie Compliance cookie status

Created on 29 March 2023, about 1 year ago

Hello!

Thank you for this module. It is really useful to me. I use together with EU Cookie Compliance module and I needed a bridge between the two, so I tried to write some code to solve my case.

Please keep in mind that this is my first patch ever, so it might not be compliant with the rules. Also, it might not be the best approach for this, but I thought I share my solution.

Problem/Motivation

Make the module be aware of the consent status the user gave using the EU Cookie Compliance module. The GDPR module blocks the video, even after the user agreed to the use of cookies.

Steps to reproduce

1. Install EU Cookie Compliance module and configure this module to "Reload page after user clicks the Agree button". This is necessary in order to unblock the videos on the page the user was when agreed to the use of cookies.
2. Install GDPR for YouTube and Vimeo module
3. Add video content on a page
4. Click the "Accept" button on the EU Cookie Compliance banner, to accept the cookies.
5. Reload the page - the videos are blocked.

Proposed resolution

In the GDPR for YouTube and Vimeo module's JS, check the value of the cookie-agreed cookie. This is the cookie placed by the EU Cookie Compliance module. If the value is different 2 (user consent to the use of cookies), then block all the videos.
Please see the attached patch.

Remaining tasks

1. Check if my approach is correct.
2. Find a way to use the "eu_cookie_compliance.changeStatus" event to unblock the videos without reloading the page.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

✨ Feature request
Status

Needs work

Version

1.1

Component

Code

Created by

πŸ‡·πŸ‡΄Romania lucian.ilea

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024