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

Updated version, cookieconsent lib, added settings to deny or allow cookies #11

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

rluetke
Copy link

@rluetke rluetke commented Oct 10, 2019

Hi naucon,

I've added plugin settings to let the user deny or allow cookies by a callback hook. A callback function is needed to enable or disable tracking, depending on the tracking system used by the website.
The possibility to deactivate tracking is needed for the new GDPR.

I updated the underlying cookieconsent lib and used settings of this lib to deny/allow/revoke cookies.
Additionally I set the version of this plugin to v0.5.0.

You can try it under https://blog.dmr-solutions.com/ (in german only) with buttons to allow or deny cookies in the cookie consent dialog. The cookie consent is used together with a Google Analytics Plugin, also extended with callback functions by me and coming soon as version 1.5: https://github.com/rluetke/grav-ganalytics.
The state of the tracking is show by a checkbox under https://blog.dmr-solutions.com/impressum: scroll to "5. Verwendung von „Google Analytics“" and look there for the checkbox.

You may revoke the cookie setting with a small link at the buttom of the browser window.

Regards, Ralf

@naucon
Copy link
Owner

naucon commented Oct 13, 2019

Hi @rluetke ,

thank you for contributing this great feature. You worked hard.
I have commented on some minor improvements. Would be great if you could implement those suggestions.

@naucon naucon self-requested a review October 13, 2019 15:07
@naucon naucon assigned naucon and rluetke and unassigned naucon Oct 13, 2019
@rluetke
Copy link
Author

rluetke commented Nov 2, 2019

Hi @naucon,
I completed the Dutch translation and I described another way to turn off tracking by evaluating the consent-cookie-value in the tracking code.

After new European jurisprudence the tracking may take place only after the user has agreed. Consequently, the first page view must not be tracked. This can be achieved by inserting the tracking code only if tracking has been allowed. The tracking code must therefore wait for the consent cookie.

I will also describe this functionality in the ganayltics plugin and add it accordingly.

Plaase accept and merge this pull request.

Regards, Ralf

@rluetke
Copy link
Author

rluetke commented Jun 20, 2021

Hi @naucon,

I spent some work on the tests. They have been outdated since long time. But now they are completing without errors. But you have to use composer v2 for composer install!.
They can be called by one of the following commands:
composer test
vendor/bin/codecept run unit
vendor/bin/codecept run
But I don't know what to do with .scrutinizer.yml because there is no code coverage defined.
So vendor/bin/codecept run --coverage --coverage-xml will return an error.
But I think this is irrelevant.

I hope, you accept the pull request, as I don't know another grav plugin, that is really compliant to GDPR.

And I made some little changes since November 2019, as you may have noticed

Regards, Ralf

@rluetke
Copy link
Author

rluetke commented Jun 21, 2021

Hi @naucon,

unfortunately the Unit-Tests pass for grav 1.6 but not for grav 1.7!
This needs more work ... to update for grav 1.7.

Regards, Ralf

@rluetke
Copy link
Author

rluetke commented Jun 21, 2021

Hi @naucon,

now the pull request is ready for acceptance. All checks have passed.
The new issue found by scrutinizer can be ignored, it is a false-positive.

Regards, Ralf

@ViliusS
Copy link

ViliusS commented Mar 9, 2023

@naucon could you merge the hard work in this ticket? I find updated cookie consent library very useful. Specifically, it as dismissOnWindowClick and some other great events to hook on in our Grav templates.

@01Kuzma
Copy link

01Kuzma commented Feb 10, 2024

@naucon, can you merge it?

@diegomagikal
Copy link

It's a great feature. Can it be merged? I downloaded it as a patch to test in my environment and noticed an issue when I used quotation marks in the callback function because it is rendered as ". So I had to add a raw function in cookieconsent.html.twig to work

"onStatusChange": {{ config.plugins.cookieconsent.callback_onStatusChange|raw }},

@othercodes
Copy link

Hi everyone, any update on merging this PR??

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.

7 participants