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

Add cookie consent example #10320

Merged
merged 11 commits into from
Feb 4, 2025

Conversation

beepsoft
Copy link
Contributor

@beepsoft beepsoft commented Feb 14, 2024

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.

cookie-consent-example

Additional documentation:

https://cookieconsent.orestbida.com/

Preview at https://dataverse-guide--10320.org.readthedocs.build/en/10320/installation/config.html#adding-cookie-consent-for-gdpr-etc

@pdurbin pdurbin added the Size: 0.5 A percentage of a sprint. 0.35 hours label Feb 28, 2024
@pdurbin
Copy link
Member

pdurbin commented Sep 27, 2024

Bah. Git is hard. I made dsd-sztaki-hu#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?

Thanks.

@pdurbin pdurbin added the Type: Feature a feature request label Oct 9, 2024
@cmbz cmbz added the FY25 Sprint 11 FY25 Sprint 11 (2024-11-20 - 2024-12-04) label Nov 22, 2024
@pdurbin
Copy link
Member

pdurbin commented Nov 25, 2024

@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! ❤️

Copy link
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks, @beepsoft!

@cmbz cmbz added the FY25 Sprint 12 FY25 Sprint 12 (2024-12-04 - 2024-12-18) label Dec 5, 2024
@cmbz cmbz added the FY25 Sprint 14 FY25 Sprint 14 (2025-01-02 - 2025-01-15) label Jan 2, 2025
@ofahimIQSS ofahimIQSS self-assigned this Jan 15, 2025
@cmbz cmbz added the FY25 Sprint 15 FY25 Sprint 15 (2025-01-15 - 2025-01-29) label Jan 15, 2025

Members of the Dataverse community have used the CookieConsent (https://cookieconsent.orestbida.com) JavaScript library for this purpose. Configuration advice is below.

To allow users to opt out of the use Google Analytics tracking you can do the following:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To allow users to opt out of the use Google Analytics tracking you can do the following:
To allow users to opt out of the use of Google Analytics tracking you can do the following:

@beepsoft
Copy link
Contributor Author

Thanks, @ofahimIQSS for the fixes!

@cmbz cmbz added the FY25 Sprint 16 FY25 Sprint 16 (2025-01-29 - 2025-02-12) label Jan 30, 2025
@ofahimIQSS
Copy link
Contributor

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?

@beepsoft
Copy link
Contributor Author

beepsoft commented Feb 4, 2025

Can you take a look at the View source of you Dataverse installation? Is the content of your analytics-code.html loaded?

@ofahimIQSS
Copy link
Contributor

ofahimIQSS commented Feb 4, 2025

should we add this to the guide as well - i believe this is the step I missed?

image

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.

@beepsoft
Copy link
Contributor Author

beepsoft commented Feb 4, 2025

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?

@ofahimIQSS
Copy link
Contributor

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!

@ofahimIQSS
Copy link
Contributor

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?

Docker wasn't setup to test this so I'm testing it in internal as soon as the version gets bumped to 6.5.

@pdurbin
Copy link
Member

pdurbin commented Feb 4, 2025

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

@ofahimIQSS
Copy link
Contributor

Docs get a thumbs up from me. I was able to see the popup. Merging PR.
image

@ofahimIQSS ofahimIQSS merged commit 06484e1 into IQSS:develop Feb 4, 2025
2 of 3 checks passed
@ofahimIQSS ofahimIQSS removed their assignment Feb 4, 2025
@pdurbin pdurbin added this to the 6.6 milestone Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FY25 Sprint 11 FY25 Sprint 11 (2024-11-20 - 2024-12-04) FY25 Sprint 12 FY25 Sprint 12 (2024-12-04 - 2024-12-18) FY25 Sprint 14 FY25 Sprint 14 (2025-01-02 - 2025-01-15) FY25 Sprint 15 FY25 Sprint 15 (2025-01-15 - 2025-01-29) FY25 Sprint 16 FY25 Sprint 16 (2025-01-29 - 2025-02-12) Size: 0.5 A percentage of a sprint. 0.35 hours Type: Feature a feature request
Projects
Status: Done 🧹
Development

Successfully merging this pull request may close these issues.

4 participants