p2-inc / phasetwo-docs

docusaurus repo for phasetwo.io public website and documentation
1 stars 12 forks source link

Add cookie consent widget #76

Closed xgp closed 2 months ago

xgp commented 1 year ago

https://github.com/orestbida/cookieconsent

xgp commented 1 year ago

https://github.com/facebook/docusaurus/issues/2407

https://github.com/Mastermindzh/react-cookie-consent

xgp commented 1 year ago

I used this elsewhere, and found it to be fairly easy to implement https://orestbida.com/demo-projects/cookieconsent/

xgp commented 10 months ago

Using our existing ToS vendor

https://www.termsfeed.com/cookie-consent/

<!-- Cookie Consent by TermsFeed https://www.TermsFeed.com -->
<script type="text/javascript" src="//www.termsfeed.com/public/cookie-consent/4.1.0/cookie-consent.js" charset="UTF-8"></script>
<script type="text/javascript" charset="UTF-8">
document.addEventListener('DOMContentLoaded', function () {
cookieconsent.run({"notice_banner_type":"headline","consent_type":"express","palette":"light","language":"en","page_load_consent_levels":["strictly-necessary"],"notice_banner_reject_button_hide":false,"preferences_center_close_button_hide":false,"page_refresh_confirmation_buttons":false,"website_privacy_policy_url":"https://phasetwo.io/docs/privacy"});
});
</script>

<!-- Google Analytics -->
<link rel="preconnect" href="https://www.google-analytics.com">
<script type="text/plain" data-cookie-consent="tracking">window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)},ga.l=+new Date,ga("create","UA-160183620-1","auto"),ga("send","pageview")</script>
<script type="text/plain" data-cookie-consent="tracking" async src="https://www.google-analytics.com/analytics.js"></script><link rel="stylesheet" href="/assets/css/styles.333b22f2.css">

<!-- end of Google Analytics-->

<noscript>Free cookie consent management tool by <a href="https://www.termsfeed.com/">TermsFeed</a></noscript>
<!-- End Cookie Consent by TermsFeed https://www.TermsFeed.com -->

<!-- Below is the link that users can use to open Preferences Center to change their preferences. Do not modify the ID parameter. Place it where appropriate, style it as needed. -->

<a href="#" id="open_preferences_center">Update cookies preferences</a>
xgp commented 2 months ago

@pnzrr we need this for compliance. No preference on what to use, other than that it's there, and not invasive/ugly.