Add cookie consent example
What this PR does / why we need it:
Adds a description how to have a cookie consent banner in a Dataverse installation to allow users to opt out of, for example, from Google Analytics tracking to comply with GDPR. Implementation is based on this chat:
https://dataverse.zulipchat.com/#narrow/stream/379673-dev/topic/Cookie.20consent.20best.20practices
Special notes for your reviewer:
I'm not sure about the formatting as I just used IntelliJ's builtin .rst support, which doesn't show code blocks and images. So, please review and adjust it to match the Dataverse documentation standards.
Suggestions on how to test this:
You should follow the instructions to see if the installation and configuration steps work.
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
It displays a cookie consent overlay (the layout of which can be configure from javascript and css), which is independent of any other Dataverse UI code. The documentation includes a screenshot of the cookie consent popup displayed.
Additional documentation:
https://cookieconsent.orestbida.com/
Bah. Git is hard. I made https://github.com/dsd-sztaki-hu/dataverse/pull/3 but it looks weird. 🤷
@beepsoft I can't push to your branch. Can you please merge the latest from "develop" into this pull request and then look at (and hopefully) adopt these two commits?
- https://github.com/pdurbin/dataverse/commit/dc8a65e9ff27e83276970247f5b2412ce2d5b3fb
- https://github.com/pdurbin/dataverse/commit/5a3e3d38a90878d81fbcf010a2485818249b665a
Thanks.
@beepsoft can you please check out my comment above? I also pinged you in the thread on Zulip: https://dataverse.zulipchat.com/#narrow/channel/379673-dev/topic/Cookie.20consent.20best.20practices/near/484383437 . Thanks! ❤️
Thanks, @ofahimIQSS for the fixes!
Was trying to test this on my local. I followed the guide but was unable to get the cookie consent popup to display on the UI.
Here is my analytics-code.html file: https://drive.google.com/file/d/1QhA4dsN-EYB2ZVhGRMwndvzNFRtyKeHb/view?usp=sharing
Any suggestions on what I can do?
Can you take a look at the View source of you Dataverse installation? Is the content of your analytics-code.html loaded?
should we add this to the guide as well - i believe this is the step I missed?
Once you have created the analytics file, run this curl command to add it to your settings (using the same file location as in the example above):
curl -X PUT -d '/var/www/dataverse/branding/analytics-code.html' http://localhost:8080/api/admin/settings/:WebAnalyticsCode
Additionally: I ran the curl command above, then restarted the dataverse instance. Still not seeing the popup.
This documentation is under the https://dataverse-guide--10320.org.readthedocs.build/en/10320/installation/config.html#web-analytics-code section, which starts with
curl -X PUT -d '/var/www/dataverse/branding/analytics-code.html' http://localhost:8080/api/admin/settings/:WebAnalyticsCode
so I assumed the reader is aware of this, but maybe it worth reminding them here again.
Now that you have analytics-code.html added, can you also see it in the sources? Also, can you see any error in the browser's console maybe?
Hello, I had issues pushing this out to internal. This is the error I got: /home/worker/workspace/IQSS_Dataverse_Internal/target/dataverse-6.5.war: No such file or directory
it built -6.4.war - can you please update the PR to 6.5. Thank you!
Now that you have
analytics-code.htmladded, can you also see it in the sources? Also, can you see any error in the browser's console maybe?
Docker wasn't setup to test this so I'm testing it in internal as soon as the version gets bumped to 6.5.
Since these are just changes to the guides we don't technically need to deploy the war file built from this branch. It should be enough to test the steps at https://dataverse-guide--10320.org.readthedocs.build/en/10320/installation/config.html#adding-cookie-consent-for-gdpr-etc
Docs get a thumbs up from me. I was able to see the popup. Merging PR.