codefog / contao-cookiebar

Display the information about cookies on your Contao website
MIT License
26 stars 9 forks source link

Real Opt-In for tracking code and other scripts #62

Closed birdmedia closed 6 years ago

birdmedia commented 6 years ago

The current version of cookiebar just displays a message and enables opt-out for Google Analytics. It would be nice, if there would be a real opt-in to publish certain lines of code only if the user agrees to the terms and conditions. Like insert field_x in header or footer when COOKIEBAR_X is set and reload the page.

qzminski commented 6 years ago

Inserting field value into the page would still have to be a JS solution as otherwise it would interfere with Contao page cache. The checkbox is only a simple local storage flag switcher and is not designed to be anything else than that.

As stated in the documentation, how you handle the analytics is an individual case and cookiebar will not provide any default solutions of out the box. For your case a page reload would be fine, but someone would maybe want to use a function that can be executed without leaving the page. In my opinion this is too specific to be a part of the extension.