Stream: dev

Topic: Cookie consent best practices


view this post on Zulip Balázs Pataki (Feb 13 2024 at 12:58):

As far as I can see there is no GDPR compliant cookie consent banner support built in to Dataverse. What is the best practice or suggestion of the community in this regard? Has anyone added such a banner to their installations? If yes, how?

I can only see one cookie used in the system, which is the standard J2EE JSESSIONID. But we would also like to add google analytics, which should be made optional, therefore we need to provide the users with a cookie-tracker management banner.

I am currently evaluating this library for this purpose https://cookieconsent.orestbida.com/, but if anyone has experience with how to do this in Dataverse, I would be grateful for any suggestions.

view this post on Zulip Balázs Pataki (Feb 13 2024 at 16:16):

This library is pretty easy to use. I could add a basic cookie consent panel available both in English or Hungarian based on the current Dataverse language and it can enable/disable the google analytics script I added to dataverse_template.xhtml

image.png
image.png

view this post on Zulip Philip Durbin 🚀 (Feb 13 2024 at 16:19):

Very cool. Would it also work in the optional header or footer? Instead of hard-coding it into the template.

view this post on Zulip Balázs Pataki (Feb 13 2024 at 16:23):

The only requirement is to have the script loaded on practically every page, so no matter where the users start using Dataverse they are presented with this popup.

What do you think the best place would be for this?

view this post on Zulip Philip Durbin 🚀 (Feb 13 2024 at 16:25):

Hmm, I think I'd suggest a custom footer. If you haven't played with it, here are the docs: https://guides.dataverse.org/en/6.1/installation/config.html#footer-block

view this post on Zulip Balázs Pataki (Feb 13 2024 at 16:29):

Oh, I see. As we have a lot of customization already all over in our Dataverse fork, I think we are OK with the template. But for other installations the custom header makes the most sense, I agree (google analytics code should be closest to the beginning of the page.)

view this post on Zulip Philip Durbin 🚀 (Feb 13 2024 at 16:33):

Yeah, I'm thinking of non-forks, how they might be able to follow your lead. Do you plan to do some sort of write up? Maybe post something on the Google Group?

view this post on Zulip Balázs Pataki (Feb 13 2024 at 19:49):

Is there maybe a section for these kind of customizations, hacks in the documentation? I can add a write up there, sure.

view this post on Zulip Philip Durbin 🚀 (Feb 13 2024 at 19:56):

Hmm, maybe we could just throw it on that configuration page? Where would you look for it?

view this post on Zulip Balázs Pataki (Feb 14 2024 at 05:31):

Maybe in Branding Your Installation or under or after Web Analytics Code.

Regarding implementation, maybe the analytics-code.html would be the best place to put the cookie consent code, as it would make a lot of sense semantically as well, because we mostly need the users' consent regarding analytics tracking.

view this post on Zulip Balázs Pataki (Feb 14 2024 at 07:08):

Added this PR: https://github.com/IQSS/dataverse/pull/10320

view this post on Zulip Philip Durbin 🚀 (Feb 14 2024 at 11:59):

I see, under https://dataverse-guide--10320.org.readthedocs.build/en/10320/installation/config.html#web-analytics-code

view this post on Zulip Philip Durbin 🚀 (Feb 14 2024 at 12:01):

Hmm, I wonder why the image isn't showing up. :thinking:

view this post on Zulip Philip Durbin 🚀 (Feb 14 2024 at 12:01):

Anyway, this is great! Thanks!

view this post on Zulip Balázs Pataki (Feb 14 2024 at 12:03):

You are welcome. Can you please also test whether the actual procedure of adding the consent popup as I described works for you?

view this post on Zulip Philip Durbin 🚀 (Feb 14 2024 at 12:30):

Well, probably not today but sure. :grinning:

view this post on Zulip Philip Durbin 🚀 (Sep 27 2024 at 14:07):

@Balázs Pataki I finally got around to fixing the image. Please see https://github.com/IQSS/dataverse/pull/10320#issuecomment-2379365698

view this post on Zulip Philip Durbin 🚀 (Sep 27 2024 at 14:07):

Also, I'm wondering if we should bring this to the new #docs group for their opinion.

view this post on Zulip Dimitri Szabo (Sep 30 2024 at 15:44):

We set up ours with https://tarteaucitron.io/en/ , but @luddaniel @Jérôme Roucou are the ones that could give you more details about it :)

view this post on Zulip Philip Durbin 🚀 (Nov 25 2024 at 20:24):

@Balázs Pataki we pulled your #10320 into the current sprint but it needs your attention. Can you please check out my comment from Sep 27? Or if you give me write access I'll push the changes myself. :smiling_imp:

view this post on Zulip Balázs Pataki (Nov 25 2024 at 20:56):

Sorry, yes, sure, I will check those!

view this post on Zulip Philip Durbin 🚀 (Nov 25 2024 at 21:02):

Thanks!

view this post on Zulip Balázs Pataki (Nov 26 2024 at 15:25):

I merged your changes in the PR, built the docs. Looks good to me. Do I need to do anything more?

view this post on Zulip Philip Durbin 🚀 (Nov 26 2024 at 15:30):

Can you please merge the latest from develop into your branch?

view this post on Zulip Balázs Pataki (Nov 26 2024 at 16:43):

Pff, didn't push it, sorry about that. What about now?

view this post on Zulip Philip Durbin 🚀 (Nov 26 2024 at 16:57):

Let's take a look at https://dataverse-guide--10320.org.readthedocs.build/en/10320/installation/config.html#adding-cookie-consent-for-gdpr-etc

view this post on Zulip Balázs Pataki (Nov 26 2024 at 16:58):

Looks like what I have locally.

view this post on Zulip Philip Durbin 🚀 (Nov 26 2024 at 17:06):

I like it. Can you please add a release note snippet? At doc/release-notes/10320-cookie-consent.md or whatever. It can say something like this:

## Cookie Consent Popup (GDPR)

For compliance with GDPR and other privacy regulations, advice ) on adding a cookie consent popup has been added to the guides. See the new [cookie consent](https://dataverse-guide--10320.org.readthedocs.build/en/10320/installation/config.html#adding-cookie-consent-for-gdpr-etc) section and #10320.

view this post on Zulip Philip Durbin 🚀 (Nov 26 2024 at 17:06):

I wrote that quickly so please fix any typos :sweat_smile:

view this post on Zulip Balázs Pataki (Nov 26 2024 at 18:39):

Sure thing! This time, a complementary push is included with the commit. :smile:

view this post on Zulip Philip Durbin 🚀 (Nov 26 2024 at 18:46):

it's a good combo :crazy:

view this post on Zulip Philip Durbin 🚀 (Nov 26 2024 at 18:47):

approved! thanks!

view this post on Zulip Philip Durbin 🚀 (Jan 23 2025 at 20:16):

@Balázs Pataki it looks like @Omer M Fahim suggested a change at https://github.com/IQSS/dataverse/pull/10320 and I agree with it.


Last updated: Nov 01 2025 at 14:11 UTC