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

[WIP] Implement cookie banner for CON and TP #836

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 104 additions & 27 deletions apps/redi-connect/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,41 +38,118 @@
`npm run build`. -->
<title>ReDI Connect</title>

<!--HotJar-->
<!-- Hotjar Tracking Code for connect.redi-school.org -->
<!-- CookieConsent resources-->
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/gh/orestbida/[email protected]/dist/cookieconsent.css"
/>
<script src="https://cdn.jsdelivr.net/gh/orestbida/[email protected]/dist/cookieconsent.umd.js"></script>

<!-- Trigger CookieConsent popover and only enable HotJar and Google Analytics if approved-->
<script async defer>
;(function (h, o, t, j, a, r) {
h.hj =
h.hj ||
function () {
;(h.hj.q = h.hj.q || []).push(arguments)
window.addEventListener('load', () => {
setupCookieConsent()
})

function setupCookieConsent() {
CookieConsent.run({
categories: {
necessary: {
enabled: true, // this category is enabled by default
readOnly: true, // this category cannot be disabled
},
analytics: {
enabled: true,
},
},

language: {
default: 'en',
translations: {
en: {
consentModal: {
title: '🍪 Cookie Information: Welcome to ReDI Connect.',
description:
'To create the best mentoring experience on ReDI Connect, we use cookies. These cookies are crucial for the smooth operation of our platform and provide insights into how you engage with mentoring content.<br /><br /><em>Your Choices Matter:</em><br /> Click "Accept all" to allow the use of all cookies. If you prefer a personalized approach, select "Cookie Preferences" to manage your preferences.',
acceptAllBtn: 'Accept all',
acceptNecessaryBtn: 'Reject all',
showPreferencesBtn: 'Manage Cookie Preferences',
},
preferencesModal: {
title: 'Manage cookie preferences',
acceptAllBtn: 'Accept all',
acceptNecessaryBtn: 'Reject all',
savePreferencesBtn: 'Accept current selection',
closeIconLabel: 'Close modal',
sections: [
{
description:
'At ReDI School, we value your privacy and strive to provide you with control over your online experience. Please customize your cookie settings below to align with your preferences.',
},
{
title: 'Strictly Necessary cookies',
description:
'These cookies are essential for the proper functioning of the website and cannot be disabled.',

//this field will generate a toggle linked to the 'necessary' category
linkedCategory: 'necessary',
},
{
title: 'Performance and Analytics',
description:
'Enable these cookies to help us improve our platform by collecting and reporting information on how you use it. The data is anonymized and cannot be used to identify you.',
linkedCategory: 'analytics',
},
],
},
},
},
},

onConsent: (consentData) => {
const allowsAnalytics =
consentData.cookie.categories.includes('analytics')
if (allowsAnalytics) {
initHotjar()
initGoogleAnalytics()
}
},
})
}
function initHotjar() {
;(function (h, o, t, j, a, r) {
h.hj =
h.hj ||
function () {
;(h.hj.q = h.hj.q || []).push(arguments)
}
h._hjSettings = {
hjid: 1322938,
hjsv: 6,
}
h._hjSettings = {
hjid: 1322938,
hjsv: 6,
a = o.getElementsByTagName('head')[0]
r = o.createElement('script')
r.async = 1
r.src = t + h._hjSettings.hjid + j + h._hjSettings.hjsv
a.appendChild(r)
})(window, document, 'https://static.hotjar.com/c/hotjar-', '.js?sv=')
}
function initGoogleAnalytics() {
window.dataLayer = window.dataLayer || []

function gtag() {
dataLayer.push(arguments)
}
a = o.getElementsByTagName('head')[0]
r = o.createElement('script')
r.async = 1
r.src = t + h._hjSettings.hjid + j + h._hjSettings.hjsv
a.appendChild(r)
})(window, document, 'https://static.hotjar.com/c/hotjar-', '.js?sv=')
gtag('js', new Date())

gtag('config', 'UA-140306226-1')
}
</script>
<!-- Global site tag (gtag.js) - Google Analytics -->

<script
async
src="https://www.googletagmanager.com/gtag/js?id=UA-140306226-1"
></script>
<script async defer>
window.dataLayer = window.dataLayer || []

function gtag() {
dataLayer.push(arguments)
}
gtag('js', new Date())

gtag('config', 'UA-140306226-1')
</script>
</head>

<body>
Expand Down
132 changes: 105 additions & 27 deletions apps/redi-talent-pool/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,39 +58,117 @@
`npm run build`. -->
<title>ReDI Talent Pool</title>

<!--HotJar-->
<!-- Hotjar Tracking Code for connect.redi-school.org -->
<!-- Hotjar Tracking Code for https://talent-pool.redi-school.org -->
<script>
;(function (h, o, t, j, a, r) {
h.hj =
h.hj ||
function () {
;(h.hj.q = h.hj.q || []).push(arguments)
}
h._hjSettings = { hjid: 2456374, hjsv: 6 }
a = o.getElementsByTagName('head')[0]
r = o.createElement('script')
r.async = 1
r.src = t + h._hjSettings.hjid + j + h._hjSettings.hjsv
a.appendChild(r)
})(window, document, 'https://static.hotjar.com/c/hotjar-', '.js?sv=')
<!-- CookieConsent resources-->
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/gh/orestbida/[email protected]/dist/cookieconsent.css"
/>
<script src="https://cdn.jsdelivr.net/gh/orestbida/[email protected]/dist/cookieconsent.umd.js"></script>

<!-- Trigger CookieConsent popover and only enable HotJar and Google Analytics if approved-->
<script async defer>
window.addEventListener('load', () => {
setupCookieConsent()
})

function setupCookieConsent() {
CookieConsent.run({
categories: {
necessary: {
enabled: true, // this category is enabled by default
readOnly: true, // this category cannot be disabled
},
analytics: {
enabled: true,
},
},

language: {
default: 'en',
translations: {
en: {
consentModal: {
title: '🍪 Cookie Information: Welcome to ReDI Talent Pool.',
description:
'To create the best mentoring experience on ReDI Talent Pool, we use cookies. These cookies are crucial for the smooth operation of our platform and provide insights into how you engage with mentoring content.<br /><br /><em>Your Choices Matter:</em><br /> Click "Accept all" to allow the use of all cookies. If you prefer a personalized approach, select "Cookie Preferences" to manage your preferences.',
acceptAllBtn: 'Accept all',
acceptNecessaryBtn: 'Reject all',
showPreferencesBtn: 'Manage Cookie Preferences',
},
preferencesModal: {
title: 'Manage cookie preferences',
acceptAllBtn: 'Accept all',
acceptNecessaryBtn: 'Reject all',
savePreferencesBtn: 'Accept current selection',
closeIconLabel: 'Close modal',
sections: [
{
description:
'At ReDI School, we value your privacy and strive to provide you with control over your online experience. Please customize your cookie settings below to align with your preferences.',
},
{
title: 'Strictly Necessary cookies',
description:
'These cookies are essential for the proper functioning of the website and cannot be disabled.',

//this field will generate a toggle linked to the 'necessary' category
linkedCategory: 'necessary',
},
{
title: 'Performance and Analytics',
description:
'Enable these cookies to help us improve our platform by collecting and reporting information on how you use it. The data is anonymized and cannot be used to identify you.',
linkedCategory: 'analytics',
},
],
},
},
},
},

onConsent: (consentData) => {
const allowsAnalytics =
consentData.cookie.categories.includes('analytics')
if (allowsAnalytics) {
initHotjar()
initGoogleAnalytics()
}
},
})
}
function initHotjar() {
;(function (h, o, t, j, a, r) {
h.hj =
h.hj ||
function () {
;(h.hj.q = h.hj.q || []).push(arguments)
}
h._hjSettings = { hjid: 2456374, hjsv: 6 }
a = o.getElementsByTagName('head')[0]
r = o.createElement('script')
r.async = 1
r.src = t + h._hjSettings.hjid + j + h._hjSettings.hjsv
a.appendChild(r)
})(window, document, 'https://static.hotjar.com/c/hotjar-', '.js?sv=')
}
function initGoogleAnalytics() {
window.dataLayer = window.dataLayer || []

function gtag() {
dataLayer.push(arguments)
}
gtag('js', new Date())

gtag('config', 'UA-140306226-1')
}
</script>

<!-- Global site tag (gtag.js) - Google Analytics -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=UA-140306226-1"
></script>
<script async defer>
window.dataLayer = window.dataLayer || []

function gtag() {
dataLayer.push(arguments)
}
gtag('js', new Date())

gtag('config', 'UA-140306226-1')
</script>
<script async defer></script>
ericbolikowski marked this conversation as resolved.
Show resolved Hide resolved
</head>

<body>
Expand Down
Loading