qw3rtty / grav-plugin-simple-cookie

The Simple Cookie Plugin is an extension for Grav. The plugin is based on the popular CookieConsent JS-library. For Advanced Opt-In/Opt-Out configurations you can use the 'Custom configuration' option.
MIT License
8 stars 2 forks source link

Example of how to use custom config object? #6

Open RCheesley opened 4 years ago

RCheesley commented 4 years ago

I was looking for an example of how to use the custom config object - e.g. to load google analytics only when the user accepts the cookie warning. Do you have an example you could share of how this could be achieved? Thanks!

qw3rtty commented 4 years ago

@RCheesley The correct format for the "Custom config" field is an JavaScript-Object which can be encode/decode to an JSON string.

Here is a working example: {"revokable":false, "revokeBtn": "<a class='test'>REVOKE</a>"}

Here is a link to the documentation of cookie consenst for all available options: https://www.osano.com/cookieconsent/documentation/javascript-api/

Right now, it is not possible to configure a callback function for "onStatusChange" for example. So right now you can't load an cookie when a user accepts the cookies. The reason is, JSON.stringify or JSON.parse can't work with functions.

I will solve this problem and let you know when i got a fix for it.

Mehditerranee commented 3 years ago

@tomschwarz Is there any news about this point ?

FYI, i have tested the example you provided and it doesn't work : i got error 500.

Could you provide a complete example of a simple-cookie.yaml file with a custom configuration (custom-config) please ?

Mehditerranee commented 3 years ago

@RCheesley Did you manage to use the custom-config parameter ? If yes, could you explain me how please ?

RCheesley commented 3 years ago

@Mehditeranee no we did not - unfortunately meaning we are unable to fully comply with GDPR requirements.

Mehditerranee commented 3 years ago

@RCheesley Ok thank you for your feedback. I don't understand how a CMS like Grav doesn't provide a full and strong solution for RGPD compliance. (because, in this case, the plugin documentation is poor and seems to not manage advanced use cases)

hughbris commented 2 years ago

I agree with the sentiment here, this feature is no good until documented properly.

I don't understand how a CMS like Grav doesn't provide a full and strong solution for RGPD compliance.

@Mehditerranee Grav doesn't have this because it's a lightweight multi-purpose CMS, not everyone needs this, and it's better achieved with plugins. Also, this allows you to take your pick of them.