From e2144076e901aed552a809703956ec76f935a4a7 Mon Sep 17 00:00:00 2001 From: ipeke94 <26484292+ipeke94@users.noreply.github.com> Date: Tue, 8 Oct 2024 10:51:44 +0200 Subject: [PATCH 1/9] feat: add cookie consent v3 --- package.json | 1 + src/@types/cookieconsent.d.ts | 54 +++++++++++++ src/components/CookieConsent.tsx | 92 +++++++++++++++++++++++ src/components/layout/leadinfo-script.tsx | 34 ++++++--- src/pages/index.tsx | 4 +- yarn.lock | 5 ++ 6 files changed, 176 insertions(+), 14 deletions(-) create mode 100644 src/@types/cookieconsent.d.ts create mode 100644 src/components/CookieConsent.tsx diff --git a/package.json b/package.json index 596ff1424..f16d61d70 100644 --- a/package.json +++ b/package.json @@ -95,6 +95,7 @@ "stylis": "^4.3.1", "unified": "^10.1.1", "util": "^0.12.5", + "vanilla-cookieconsent": "3.0.1", "webpack": "^5.84.1", "what-input": "^5.2.12" }, diff --git a/src/@types/cookieconsent.d.ts b/src/@types/cookieconsent.d.ts new file mode 100644 index 000000000..12fd257a8 --- /dev/null +++ b/src/@types/cookieconsent.d.ts @@ -0,0 +1,54 @@ +declare module 'vanilla-cookieconsent' { + interface CookieValue { + categories: { + necessary: boolean; + analytics: boolean; + }; + } + + interface CookieConsentCallbackParam { + cookie: CookieValue; + } + + interface CookieConsentConfig { + categories: { + necessary: { + enabled: boolean; + readOnly: boolean; + }; + analytics: { + enabled: boolean; + }; + }; + language: { + default: string; + translations: { + [key: string]: { + consentModal: { + title: string; + description: string; + acceptAllBtn: string; + acceptNecessaryBtn: string; + showPreferencesBtn: string; + }; + preferencesModal: { + title: string; + acceptAllBtn: string; + acceptNecessaryBtn: string; + savePreferencesBtn: string; + closeIconLabel: string; + sections: Array<{ + title: string; + description: string; + linkedCategory?: string; + }>; + }; + }; + }; + }; + onFirstConsent?: (param: CookieConsentCallbackParam) => void; + onConsentChange?: (param: CookieConsentCallbackParam) => void; + } + + export function run(config: CookieConsentConfig): void; +} diff --git a/src/components/CookieConsent.tsx b/src/components/CookieConsent.tsx new file mode 100644 index 000000000..2b58312a3 --- /dev/null +++ b/src/components/CookieConsent.tsx @@ -0,0 +1,92 @@ +import React, { useEffect, useState } from 'react'; +import 'vanilla-cookieconsent/dist/cookieconsent.css'; +import * as CookieConsent from 'vanilla-cookieconsent'; +import LeadinfoScript from '../components/layout/leadinfo-script'; + +const CookieConsentComponentV3 = () => { + const [analyticsEnabled, setAnalyticsEnabled] = useState(false); + + useEffect(() => { + CookieConsent.run({ + categories: { + necessary: { + enabled: true, + readOnly: true, + }, + analytics: { + enabled: false, + }, + }, + language: { + default: 'en', + translations: { + en: { + consentModal: { + title: 'We use cookies', + description: + 'This website uses cookies to ensure the best user experience.', + acceptAllBtn: 'Accept all', + acceptNecessaryBtn: 'Reject all', + showPreferencesBtn: 'Manage preferences', + }, + preferencesModal: { + title: 'Manage Cookie Preferences', + acceptAllBtn: 'Accept all', + acceptNecessaryBtn: 'Accept necessary only', + savePreferencesBtn: 'Save preferences', + closeIconLabel: 'Close', + sections: [ + { + title: 'Strictly Necessary Cookies', + description: + 'These cookies are essential for website functionality and cannot be disabled.', + linkedCategory: 'necessary', + }, + { + title: 'Analytics Cookies', + description: + 'We use analytics cookies to analyze website usage and improve our services.', + linkedCategory: 'analytics', + }, + ], + }, + }, + }, + }, + onFirstConsent: (param) => { + handleConsent(param.cookie.categories); + }, + onConsentChange: (param) => { + handleConsent(param.cookie.categories); + }, + }); + }, []); + + const handleConsent = (categories) => { + const isAnalyticsAccepted = categories.includes('analytics'); + + if (isAnalyticsAccepted) { + setAnalyticsEnabled(true); + setLeadinfoCookies(); + } else { + setAnalyticsEnabled(false); + clearLeadinfoCookies(); + } + }; + + const setLeadinfoCookies = () => { + const twoYears = 63072000; + const sessionValue = new Date().toISOString(); + document.cookie = `_li_id=some_value; max-age=${twoYears}; path=/`; + document.cookie = `_li_ses=${sessionValue}; max-age=0; path=/`; + }; + + const clearLeadinfoCookies = () => { + document.cookie = '_li_id=; max-age=0; path=/'; + document.cookie = '_li_ses=; max-age=0; path=/'; + }; + + return ; +}; + +export default CookieConsentComponentV3; diff --git a/src/components/layout/leadinfo-script.tsx b/src/components/layout/leadinfo-script.tsx index 5e6ebc296..46df9d602 100644 --- a/src/components/layout/leadinfo-script.tsx +++ b/src/components/layout/leadinfo-script.tsx @@ -1,20 +1,30 @@ -import { useEffect } from 'react'; +import { useEffect, useState } from 'react'; + +let leadinfoInitialized = false; + +const LeadinfoScript = ({ enable }: { enable: boolean }) => { + const [script, setScript] = useState(null); -const LeadinfoScript = () => { useEffect(() => { - const script = document.createElement('script'); - script.innerHTML = ` - (function(l,e,a,d,i,n,f,o){if(!l[i]){l.GlobalLeadinfoNamespace=l.GlobalLeadinfoNamespace||[]; - l.GlobalLeadinfoNamespace.push(i);l[i]=function(){(l[i].q=l[i].q||[]).push(arguments)};l[i].t=l[i].t||n; - l[i].q=l[i].q||[];o=e.createElement(a);f=e.getElementsByTagName(a)[0];o.async=1;o.src=d;f.parentNode.insertBefore(o,f);} - }(window,document,'script','https://cdn.leadinfo.eu/ping.js','leadinfo','LI-66D184CC97CFD')); + if (enable && !leadinfoInitialized) { + const leadinfoScript = document.createElement('script'); + leadinfoScript.innerHTML = ` + (function(l,e,a,d,i,n,f,o){if(!l[i]){l.GlobalLeadinfoNamespace=l.GlobalLeadinfoNamespace||[]; + l.GlobalLeadinfoNamespace.push(i);l[i]=function(){(l[i].q=l[i].q||[]).push(arguments)};l[i].t=l[i].t||n; + l[i].q=l[i].q||[];o=e.createElement(a);f=e.getElementsByTagName(a)[0];o.async=1;o.src=d;f.parentNode.insertBefore(o,f);} + }(window,document,'script','https://cdn.leadinfo.eu/ping.js','leadinfo','LI-66D184CC97CFD')); `; - document.head.appendChild(script); + document.head.appendChild(leadinfoScript); + setScript(leadinfoScript); + leadinfoInitialized = true; + } - return () => { + if (!enable && leadinfoInitialized && script) { document.head.removeChild(script); - }; - }, []); + setScript(null); + leadinfoInitialized = false; + } + }, [enable, script]); return null; }; diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 2f97547c6..208e43283 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -11,7 +11,7 @@ import { } from '../types'; import { IGatsbyImageData } from 'gatsby-plugin-image'; import { StructuredOrganizationData } from '../components/pages/landingpage/structured-organization-data'; -import LeadinfoScript from '../components/layout/leadinfo-script'; // Import the new component +import CookieConsentComponentV3 from '../components/CookieConsent'; export interface OfficeImage { relativePath: string; @@ -72,8 +72,8 @@ export const Head = ({ data, location }: PageProps) => { rssLink locales={data.locales} /> + - ); }; diff --git a/yarn.lock b/yarn.lock index 38d0c5f18..08748363b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15148,6 +15148,11 @@ value-or-promise@^1.0.12: resolved "https://registry.yarnpkg.com/value-or-promise/-/value-or-promise-1.0.12.tgz#0e5abfeec70148c78460a849f6b003ea7986f15c" integrity sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q== +vanilla-cookieconsent@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/vanilla-cookieconsent/-/vanilla-cookieconsent-3.0.1.tgz#059d1b2c712476ae4172d4ec7fa9d553a16be12d" + integrity sha512-gqc4x7O9t1I4xWr7x6/jtQWPr4PZK26SmeA0iyTv1WyoECfAGnu5JEOExmMEP+5Fz66AT9OiCBO3GII4wDQHLw== + vary@^1, vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" From c488fbfb6b99b6ecf1ea5f96c00255a96df52a4a Mon Sep 17 00:00:00 2001 From: ipeke94 <26484292+ipeke94@users.noreply.github.com> Date: Fri, 11 Oct 2024 12:09:51 +0200 Subject: [PATCH 2/9] chore: add types/cookieconsent as package --- package.json | 1 + src/@types/cookieconsent.d.ts | 54 ----------------------------------- yarn.lock | 7 +++++ 3 files changed, 8 insertions(+), 54 deletions(-) delete mode 100644 src/@types/cookieconsent.d.ts diff --git a/package.json b/package.json index f16d61d70..11791bd5d 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "@reach/tabs": "^0.18.0", "@slack/web-api": "^6.11.2", "@svgr/webpack": "^8.0.1", + "@types/cookieconsent": "^3.1.3", "@types/leaflet": "^1.9.8", "axios": "^1.6.5", "babel-plugin-styled-components": "^2.1.3", diff --git a/src/@types/cookieconsent.d.ts b/src/@types/cookieconsent.d.ts deleted file mode 100644 index 12fd257a8..000000000 --- a/src/@types/cookieconsent.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -declare module 'vanilla-cookieconsent' { - interface CookieValue { - categories: { - necessary: boolean; - analytics: boolean; - }; - } - - interface CookieConsentCallbackParam { - cookie: CookieValue; - } - - interface CookieConsentConfig { - categories: { - necessary: { - enabled: boolean; - readOnly: boolean; - }; - analytics: { - enabled: boolean; - }; - }; - language: { - default: string; - translations: { - [key: string]: { - consentModal: { - title: string; - description: string; - acceptAllBtn: string; - acceptNecessaryBtn: string; - showPreferencesBtn: string; - }; - preferencesModal: { - title: string; - acceptAllBtn: string; - acceptNecessaryBtn: string; - savePreferencesBtn: string; - closeIconLabel: string; - sections: Array<{ - title: string; - description: string; - linkedCategory?: string; - }>; - }; - }; - }; - }; - onFirstConsent?: (param: CookieConsentCallbackParam) => void; - onConsentChange?: (param: CookieConsentCallbackParam) => void; - } - - export function run(config: CookieConsentConfig): void; -} diff --git a/yarn.lock b/yarn.lock index 08748363b..e1d255de1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3040,6 +3040,13 @@ resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.4.1.tgz#bfd02c1f2224567676c1545199f87c3a861d878d" integrity sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q== +"@types/cookieconsent@^3.1.3": + version "3.1.3" + resolved "https://registry.yarnpkg.com/@types/cookieconsent/-/cookieconsent-3.1.3.tgz#9c4db317fba44eec32f9d8858b8860b31eff2262" + integrity sha512-fWEDj/bX5V1uXtpINNXkDspgWp8756PgaDaFzOYrFox2dRadkOCSMnUnUIBmYI+oYO2w4x6DhS8NICD8oVO/FA== + dependencies: + csstype "^3.0.2" + "@types/cors@^2.8.12": version "2.8.17" resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.17.tgz#5d718a5e494a8166f569d986794e49c48b216b2b" From afafd878492d3501d0c1d97bb25cbe6ec0ad8857 Mon Sep 17 00:00:00 2001 From: ipeke94 <26484292+ipeke94@users.noreply.github.com> Date: Fri, 11 Oct 2024 12:10:31 +0200 Subject: [PATCH 3/9] feat: delete necessary category --- src/components/CookieConsent.tsx | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/components/CookieConsent.tsx b/src/components/CookieConsent.tsx index 2b58312a3..47b097162 100644 --- a/src/components/CookieConsent.tsx +++ b/src/components/CookieConsent.tsx @@ -9,10 +9,6 @@ const CookieConsentComponentV3 = () => { useEffect(() => { CookieConsent.run({ categories: { - necessary: { - enabled: true, - readOnly: true, - }, analytics: { enabled: false, }, @@ -32,16 +28,10 @@ const CookieConsentComponentV3 = () => { preferencesModal: { title: 'Manage Cookie Preferences', acceptAllBtn: 'Accept all', - acceptNecessaryBtn: 'Accept necessary only', + acceptNecessaryBtn: 'Reject all', savePreferencesBtn: 'Save preferences', closeIconLabel: 'Close', sections: [ - { - title: 'Strictly Necessary Cookies', - description: - 'These cookies are essential for website functionality and cannot be disabled.', - linkedCategory: 'necessary', - }, { title: 'Analytics Cookies', description: @@ -56,9 +46,6 @@ const CookieConsentComponentV3 = () => { onFirstConsent: (param) => { handleConsent(param.cookie.categories); }, - onConsentChange: (param) => { - handleConsent(param.cookie.categories); - }, }); }, []); From 3b374f03b278ccb3bc687db92ec022a79433c9db Mon Sep 17 00:00:00 2001 From: ipeke94 <26484292+ipeke94@users.noreply.github.com> Date: Fri, 11 Oct 2024 15:04:47 +0200 Subject: [PATCH 4/9] feat: add cookie translations --- src/assets/locales/en/translations.json | 16 +++++++++- src/components/CookieConsent.tsx | 39 +++++++++++++++---------- src/pages/index.tsx | 26 +++++++++-------- 3 files changed, 53 insertions(+), 28 deletions(-) diff --git a/src/assets/locales/en/translations.json b/src/assets/locales/en/translations.json index f7433689c..859d4df21 100644 --- a/src/assets/locales/en/translations.json +++ b/src/assets/locales/en/translations.json @@ -88,5 +88,19 @@ "blog.copied": "Copied", "blog.follow": "Subscribe to blog", "blog.pagination": "Page", - "image.attribution": "Photo by " + "image.attribution": "Photo by ", + "consentModal.title": "We use cookies", + "consentModal.description": "This website uses cookies to ensure the best user experience.", + "consentModal.acceptAllBtn": "Accept all", + "consentModal.acceptNecessaryBtn": "Reject all", + "consentModal.showPreferencesBtn": "Manage preferences", + "preferencesModal.title": "Manage Cookie Preferences", + "preferencesModal.acceptAllBtn": "Accept all", + "preferencesModal.acceptNecessaryBtn": "Accept necessary only", + "preferencesModal.savePreferencesBtn": "Save preferences", + "preferencesModal.closeIconLabel": "Close", + "preferencesModal.sections.necessary.title": "Strictly Necessary Cookies", + "preferencesModal.sections.necessary.description": "These cookies are essential for website functionality and cannot be disabled.", + "preferencesModal.sections.analytics.title": "Analytics Cookies", + "preferencesModal.sections.analytics.description": "We use analytics cookies to analyze website usage and improve our services." } diff --git a/src/components/CookieConsent.tsx b/src/components/CookieConsent.tsx index 47b097162..ac425e447 100644 --- a/src/components/CookieConsent.tsx +++ b/src/components/CookieConsent.tsx @@ -2,8 +2,10 @@ import React, { useEffect, useState } from 'react'; import 'vanilla-cookieconsent/dist/cookieconsent.css'; import * as CookieConsent from 'vanilla-cookieconsent'; import LeadinfoScript from '../components/layout/leadinfo-script'; +import { useTranslation } from 'react-i18next'; const CookieConsentComponentV3 = () => { + const { t } = useTranslation(); const [analyticsEnabled, setAnalyticsEnabled] = useState(false); useEffect(() => { @@ -18,24 +20,31 @@ const CookieConsentComponentV3 = () => { translations: { en: { consentModal: { - title: 'We use cookies', - description: - 'This website uses cookies to ensure the best user experience.', - acceptAllBtn: 'Accept all', - acceptNecessaryBtn: 'Reject all', - showPreferencesBtn: 'Manage preferences', + title: t('consentModal.title'), + description: t('consentModal.description'), + acceptAllBtn: t('consentModal.acceptAllBtn'), + acceptNecessaryBtn: t('consentModal.acceptNecessaryBtn'), + showPreferencesBtn: t('consentModal.showPreferencesBtn'), }, preferencesModal: { - title: 'Manage Cookie Preferences', - acceptAllBtn: 'Accept all', - acceptNecessaryBtn: 'Reject all', - savePreferencesBtn: 'Save preferences', - closeIconLabel: 'Close', + title: t('preferencesModal.title'), + acceptAllBtn: t('preferencesModal.acceptAllBtn'), + acceptNecessaryBtn: t('preferencesModal.acceptNecessaryBtn'), + savePreferencesBtn: t('preferencesModal.savePreferencesBtn'), + closeIconLabel: t('preferencesModal.closeIconLabel'), sections: [ { - title: 'Analytics Cookies', - description: - 'We use analytics cookies to analyze website usage and improve our services.', + title: t('preferencesModal.sections.necessary.title'), + description: t( + 'preferencesModal.sections.necessary.description', + ), + linkedCategory: 'necessary', + }, + { + title: t('preferencesModal.sections.analytics.title'), + description: t( + 'preferencesModal.sections.analytics.description', + ), linkedCategory: 'analytics', }, ], @@ -47,7 +56,7 @@ const CookieConsentComponentV3 = () => { handleConsent(param.cookie.categories); }, }); - }, []); + }, [t]); const handleConsent = (categories) => { const isAnalyticsAccepted = categories.includes('analytics'); diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 208e43283..32e9689bf 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -47,17 +47,20 @@ const IndexPage = ({ data }: PageProps) => { }, {}); return ( - + <> + + + ); }; @@ -72,7 +75,6 @@ export const Head = ({ data, location }: PageProps) => { rssLink locales={data.locales} /> - ); From e6e87877714df6fc616953180a82a90b89d5f9f4 Mon Sep 17 00:00:00 2001 From: ipeke94 <26484292+ipeke94@users.noreply.github.com> Date: Mon, 14 Oct 2024 13:53:03 +0200 Subject: [PATCH 5/9] fix: move translations into different files --- .../de/cookie-consent-translations.json | 21 +++++++++++ .../en/cookie-consent-translations.json | 21 +++++++++++ src/assets/locales/en/translations.json | 16 +------- src/components/CookieConsent.tsx | 37 ++----------------- src/components/i18n-helpers.tsx | 9 +++++ tsconfig.json | 4 +- 6 files changed, 59 insertions(+), 49 deletions(-) create mode 100644 src/assets/locales/de/cookie-consent-translations.json create mode 100644 src/assets/locales/en/cookie-consent-translations.json diff --git a/src/assets/locales/de/cookie-consent-translations.json b/src/assets/locales/de/cookie-consent-translations.json new file mode 100644 index 000000000..05a57756f --- /dev/null +++ b/src/assets/locales/de/cookie-consent-translations.json @@ -0,0 +1,21 @@ +{ + "consentModal": { + "title": "Wir verwenden Cookies", + "description": "Diese Website verwendet Cookies, um die beste Benutzererfahrung zu gewährleisten.", + "acceptAllBtn": "Alle akzeptieren", + "showPreferencesBtn": "Präferenzen verwalten" + }, + "preferencesModal": { + "title": "Cookie-Präferenzen verwalten", + "acceptAllBtn": "Alle akzeptieren", + "savePreferencesBtn": "Präferenzen speichern", + "closeIconLabel": "Schließen", + "sections": [ + { + "title": "Analytische Cookies", + "description": "Wir verwenden analytische Cookies, um die Nutzung der Website zu analysieren und unsere Dienste zu verbessern.", + "linkedCategory": "analytik" + } + ] + } +} diff --git a/src/assets/locales/en/cookie-consent-translations.json b/src/assets/locales/en/cookie-consent-translations.json new file mode 100644 index 000000000..e906b1650 --- /dev/null +++ b/src/assets/locales/en/cookie-consent-translations.json @@ -0,0 +1,21 @@ +{ + "consentModal": { + "title": "We use Cookies", + "description": "This website uses cookies to ensure the best user experience.", + "acceptAllBtn": "Accept All", + "showPreferencesBtn": "Manage Preferences" + }, + "preferencesModal": { + "title": "Manage Cookie Preferences", + "acceptAllBtn": "Accept All", + "savePreferencesBtn": "Save Preferences", + "closeIconLabel": "Close", + "sections": [ + { + "title": "Analytical Cookies", + "description": "We use analytical cookies to analyze the usage of the website and improve our services.", + "linkedCategory": "analytics" + } + ] + } +} diff --git a/src/assets/locales/en/translations.json b/src/assets/locales/en/translations.json index 859d4df21..f7433689c 100644 --- a/src/assets/locales/en/translations.json +++ b/src/assets/locales/en/translations.json @@ -88,19 +88,5 @@ "blog.copied": "Copied", "blog.follow": "Subscribe to blog", "blog.pagination": "Page", - "image.attribution": "Photo by ", - "consentModal.title": "We use cookies", - "consentModal.description": "This website uses cookies to ensure the best user experience.", - "consentModal.acceptAllBtn": "Accept all", - "consentModal.acceptNecessaryBtn": "Reject all", - "consentModal.showPreferencesBtn": "Manage preferences", - "preferencesModal.title": "Manage Cookie Preferences", - "preferencesModal.acceptAllBtn": "Accept all", - "preferencesModal.acceptNecessaryBtn": "Accept necessary only", - "preferencesModal.savePreferencesBtn": "Save preferences", - "preferencesModal.closeIconLabel": "Close", - "preferencesModal.sections.necessary.title": "Strictly Necessary Cookies", - "preferencesModal.sections.necessary.description": "These cookies are essential for website functionality and cannot be disabled.", - "preferencesModal.sections.analytics.title": "Analytics Cookies", - "preferencesModal.sections.analytics.description": "We use analytics cookies to analyze website usage and improve our services." + "image.attribution": "Photo by " } diff --git a/src/components/CookieConsent.tsx b/src/components/CookieConsent.tsx index ac425e447..68f0a0af1 100644 --- a/src/components/CookieConsent.tsx +++ b/src/components/CookieConsent.tsx @@ -3,9 +3,10 @@ import 'vanilla-cookieconsent/dist/cookieconsent.css'; import * as CookieConsent from 'vanilla-cookieconsent'; import LeadinfoScript from '../components/layout/leadinfo-script'; import { useTranslation } from 'react-i18next'; +import { getCookieConsentLocale } from '../components/i18n-helpers'; const CookieConsentComponentV3 = () => { - const { t } = useTranslation(); + const { t, i18n } = useTranslation(); const [analyticsEnabled, setAnalyticsEnabled] = useState(false); useEffect(() => { @@ -18,38 +19,8 @@ const CookieConsentComponentV3 = () => { language: { default: 'en', translations: { - en: { - consentModal: { - title: t('consentModal.title'), - description: t('consentModal.description'), - acceptAllBtn: t('consentModal.acceptAllBtn'), - acceptNecessaryBtn: t('consentModal.acceptNecessaryBtn'), - showPreferencesBtn: t('consentModal.showPreferencesBtn'), - }, - preferencesModal: { - title: t('preferencesModal.title'), - acceptAllBtn: t('preferencesModal.acceptAllBtn'), - acceptNecessaryBtn: t('preferencesModal.acceptNecessaryBtn'), - savePreferencesBtn: t('preferencesModal.savePreferencesBtn'), - closeIconLabel: t('preferencesModal.closeIconLabel'), - sections: [ - { - title: t('preferencesModal.sections.necessary.title'), - description: t( - 'preferencesModal.sections.necessary.description', - ), - linkedCategory: 'necessary', - }, - { - title: t('preferencesModal.sections.analytics.title'), - description: t( - 'preferencesModal.sections.analytics.description', - ), - linkedCategory: 'analytics', - }, - ], - }, - }, + en: getCookieConsentLocale(i18n.language), + de: getCookieConsentLocale(i18n.language), }, }, onFirstConsent: (param) => { diff --git a/src/components/i18n-helpers.tsx b/src/components/i18n-helpers.tsx index 8d34b687e..1231254f2 100644 --- a/src/components/i18n-helpers.tsx +++ b/src/components/i18n-helpers.tsx @@ -3,6 +3,8 @@ import { format, parseISO } from 'date-fns'; import { enGB, de } from 'date-fns/locale'; import React from 'react'; import { UseTranslationOptions } from 'react-i18next'; +import enCookieConsentTranslations from '../assets/locales/en/cookie-consent-translations.json'; +import deCookieConsentTranslations from '../assets/locales/de/cookie-consent-translations.json'; export const LONG_DATE_FORMAT = 'dd. MMMM yyyy'; @@ -53,3 +55,10 @@ export const useTranslationParagraphs = ( return { t, tWithParagraphs, useTranslationResponse }; }; + +export const getCookieConsentLocale = (language) => { + if (language === 'de') { + return deCookieConsentTranslations; + } + return enCookieConsentTranslations; +}; diff --git a/tsconfig.json b/tsconfig.json index a0d77f406..1a34ab1c1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,9 @@ "noUnusedLocals": false, "skipLibCheck": true, "allowJs": true, - "noImplicitAny": false + "noImplicitAny": false, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true }, "exclude": ["node_modules", "public", ".cache"] } From 08869df21117b9f87bdb0b1483cb3af6d459d435 Mon Sep 17 00:00:00 2001 From: ipeke94 <26484292+ipeke94@users.noreply.github.com> Date: Mon, 14 Oct 2024 22:45:04 +0200 Subject: [PATCH 6/9] feat: testing leadinfo analytics functionality --- .../de/cookie-consent-translations.json | 34 ++++++++++---- .../en/cookie-consent-translations.json | 32 +++++++++---- src/components/CookieConsent.tsx | 32 +------------ src/components/layout/leadinfo-script.tsx | 45 +++++++++---------- 4 files changed, 73 insertions(+), 70 deletions(-) diff --git a/src/assets/locales/de/cookie-consent-translations.json b/src/assets/locales/de/cookie-consent-translations.json index 05a57756f..68de689b3 100644 --- a/src/assets/locales/de/cookie-consent-translations.json +++ b/src/assets/locales/de/cookie-consent-translations.json @@ -1,20 +1,36 @@ { "consentModal": { - "title": "Wir verwenden Cookies", - "description": "Diese Website verwendet Cookies, um die beste Benutzererfahrung zu gewährleisten.", - "acceptAllBtn": "Alle akzeptieren", - "showPreferencesBtn": "Präferenzen verwalten" + "title": "Ihre Datenschutzoptionen", + "description": "Wir verwenden Cookies, um Ihre Erfahrung zu verbessern, den Datenverkehr zu analysieren und personalisierte Inhalte bereitzustellen. Sie können entweder alle Cookies akzeptieren oder Ihre Präferenzen für verschiedene Kategorien verwalten.", + "acceptAllBtn": "Alle Cookies akzeptieren", + "acceptNecessaryBtn": "Alle ablehnen", + "showPreferencesBtn": "Cookie-Präferenzen verwalten" }, "preferencesModal": { - "title": "Cookie-Präferenzen verwalten", - "acceptAllBtn": "Alle akzeptieren", + "title": "Verwalten Sie Ihre Cookie-Präferenzen", + "acceptAllBtn": "Alle Cookies akzeptieren", + "acceptNecessaryBtn": "Alle ablehnen", "savePreferencesBtn": "Präferenzen speichern", "closeIconLabel": "Schließen", "sections": [ { - "title": "Analytische Cookies", - "description": "Wir verwenden analytische Cookies, um die Nutzung der Website zu analysieren und unsere Dienste zu verbessern.", - "linkedCategory": "analytik" + "title": "Cookie-Nutzung", + "description": "Unsere Website verwendet Cookies, um wesentliche Funktionen sicherzustellen, Ihr Surferlebnis zu verbessern und personalisierte Inhalte bereitzustellen. Einige Cookies sind erforderlich, während andere uns helfen, unsere Dienste zu verbessern." + }, + { + "title": "Leistungs- und Analyse-Cookies", + "description": "Diese Cookies helfen uns, zu analysieren, wie Besucher mit unserer Website interagieren, und ermöglichen es uns, die Leistung zu messen und zu verbessern. Sie sammeln Informationen in anonymer Form.", + "linkedCategory": "analytics" + }, + { + "title": "Funktionalitäts-Cookies", + "description": "Diese Cookies ermöglichen es der Website, sich an Ihre Entscheidungen zu erinnern, wie z.B. Ihren Benutzernamen, die Sprache oder die Region, in der Sie sich befinden, und bieten erweiterte, persönlichere Funktionen.", + "linkedCategory": "functionality" + }, + { + "title": "Zielgerichtete und Werbe-Cookies", + "description": "Diese Cookies können von unseren Werbepartnern über unsere Website gesetzt werden. Sie können verwendet werden, um ein Profil Ihrer Interessen zu erstellen und Ihnen relevante Werbung auf anderen Websites anzuzeigen. Sie speichern keine direkten personenbezogenen Daten, basieren jedoch auf der eindeutigen Identifizierung Ihres Browsers und Ihres Internetgeräts.", + "linkedCategory": "advertising" } ] } diff --git a/src/assets/locales/en/cookie-consent-translations.json b/src/assets/locales/en/cookie-consent-translations.json index e906b1650..b1ae55cc0 100644 --- a/src/assets/locales/en/cookie-consent-translations.json +++ b/src/assets/locales/en/cookie-consent-translations.json @@ -1,20 +1,36 @@ { "consentModal": { - "title": "We use Cookies", - "description": "This website uses cookies to ensure the best user experience.", - "acceptAllBtn": "Accept All", - "showPreferencesBtn": "Manage Preferences" + "title": "Your Privacy Choices", + "description": "We use cookies to enhance your experience, analyze traffic, and deliver personalized content. You can choose to accept all cookies or manage your preferences for different categories.", + "acceptAllBtn": "Accept All Cookies", + "acceptNecessaryBtn": "Reject all", + "showPreferencesBtn": "Manage Cookie Preferences" }, "preferencesModal": { - "title": "Manage Cookie Preferences", - "acceptAllBtn": "Accept All", + "title": "Manage Your Cookie Preferences", + "acceptAllBtn": "Accept All Cookies", + "acceptNecessaryBtn": "Reject all", "savePreferencesBtn": "Save Preferences", "closeIconLabel": "Close", "sections": [ { - "title": "Analytical Cookies", - "description": "We use analytical cookies to analyze the usage of the website and improve our services.", + "title": "Cookie Usage", + "description": "Our website uses cookies to ensure essential functionality, enhance your browsing experience, and provide personalized content. Some cookies are required, while others help us improve our services." + }, + { + "title": "Performance and Analytics Cookies", + "description": "These cookies help us analyze how visitors interact with our website, allowing us to measure and improve performance. They collect information in an anonymous form.", "linkedCategory": "analytics" + }, + { + "title": "Functionality Cookies", + "description": "These cookies allow the website to remember choices you make, such as your username, language, or the region you are in, and provide enhanced, more personal features.", + "linkedCategory": "functionality" + }, + { + "title": "Targeting and Advertising Cookies", + "description": "These cookies may be set through our site by our advertising partners. They may be used to build a profile of your interests and show you relevant ads on other sites. They do not store personal information directly but are based on uniquely identifying your browser and internet device.", + "linkedCategory": "advertising" } ] } diff --git a/src/components/CookieConsent.tsx b/src/components/CookieConsent.tsx index 68f0a0af1..187365d7f 100644 --- a/src/components/CookieConsent.tsx +++ b/src/components/CookieConsent.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from 'react'; +import React, { useEffect } from 'react'; import 'vanilla-cookieconsent/dist/cookieconsent.css'; import * as CookieConsent from 'vanilla-cookieconsent'; import LeadinfoScript from '../components/layout/leadinfo-script'; @@ -7,7 +7,6 @@ import { getCookieConsentLocale } from '../components/i18n-helpers'; const CookieConsentComponentV3 = () => { const { t, i18n } = useTranslation(); - const [analyticsEnabled, setAnalyticsEnabled] = useState(false); useEffect(() => { CookieConsent.run({ @@ -23,37 +22,10 @@ const CookieConsentComponentV3 = () => { de: getCookieConsentLocale(i18n.language), }, }, - onFirstConsent: (param) => { - handleConsent(param.cookie.categories); - }, }); }, [t]); - const handleConsent = (categories) => { - const isAnalyticsAccepted = categories.includes('analytics'); - - if (isAnalyticsAccepted) { - setAnalyticsEnabled(true); - setLeadinfoCookies(); - } else { - setAnalyticsEnabled(false); - clearLeadinfoCookies(); - } - }; - - const setLeadinfoCookies = () => { - const twoYears = 63072000; - const sessionValue = new Date().toISOString(); - document.cookie = `_li_id=some_value; max-age=${twoYears}; path=/`; - document.cookie = `_li_ses=${sessionValue}; max-age=0; path=/`; - }; - - const clearLeadinfoCookies = () => { - document.cookie = '_li_id=; max-age=0; path=/'; - document.cookie = '_li_ses=; max-age=0; path=/'; - }; - - return ; + return ; }; export default CookieConsentComponentV3; diff --git a/src/components/layout/leadinfo-script.tsx b/src/components/layout/leadinfo-script.tsx index 46df9d602..58fc10bcd 100644 --- a/src/components/layout/leadinfo-script.tsx +++ b/src/components/layout/leadinfo-script.tsx @@ -1,30 +1,29 @@ -import { useEffect, useState } from 'react'; +import { useEffect } from 'react'; -let leadinfoInitialized = false; +const LeadinfoScript = () => { + useEffect(() => { + const leadinfoScript = document.createElement('script'); + leadinfoScript.setAttribute('type', 'text/plain'); + leadinfoScript.setAttribute('data-category', 'analytics'); -const LeadinfoScript = ({ enable }: { enable: boolean }) => { - const [script, setScript] = useState(null); + leadinfoScript.innerHTML = ` + (function(l,e,a,d,i,n,f,o){if(!l[i]){l.GlobalLeadinfoNamespace=l.GlobalLeadinfoNamespace||[]; + l.GlobalLeadinfoNamespace.push(i);l[i]=function(){(l[i].q=l[i].q||[]).push(arguments)};l[i].t=l[i].t||n; + l[i].q=l[i].q||[];o=e.createElement(a);f=e.getElementsByTagName(a)[0];o.async=1;o.src=d;f.parentNode.insertBefore(o,f);} + }(window,document,'script','https://cdn.leadinfo.eu/ping.js','leadinfo','LI-66D184CC97CFD')); + `; - useEffect(() => { - if (enable && !leadinfoInitialized) { - const leadinfoScript = document.createElement('script'); - leadinfoScript.innerHTML = ` - (function(l,e,a,d,i,n,f,o){if(!l[i]){l.GlobalLeadinfoNamespace=l.GlobalLeadinfoNamespace||[]; - l.GlobalLeadinfoNamespace.push(i);l[i]=function(){(l[i].q=l[i].q||[]).push(arguments)};l[i].t=l[i].t||n; - l[i].q=l[i].q||[];o=e.createElement(a);f=e.getElementsByTagName(a)[0];o.async=1;o.src=d;f.parentNode.insertBefore(o,f);} - }(window,document,'script','https://cdn.leadinfo.eu/ping.js','leadinfo','LI-66D184CC97CFD')); - `; - document.head.appendChild(leadinfoScript); - setScript(leadinfoScript); - leadinfoInitialized = true; - } + document.head.appendChild(leadinfoScript); - if (!enable && leadinfoInitialized && script) { - document.head.removeChild(script); - setScript(null); - leadinfoInitialized = false; - } - }, [enable, script]); + return () => { + const existingScript = document.querySelector( + 'script[data-category="analytics"]', + ); + if (existingScript) { + document.head.removeChild(existingScript); + } + }; + }, []); return null; }; From 50a617580a77f54ddd03e3954f8a4441cf748af1 Mon Sep 17 00:00:00 2001 From: ipeke94 <26484292+ipeke94@users.noreply.github.com> Date: Tue, 15 Oct 2024 11:45:10 +0200 Subject: [PATCH 7/9] feat: update cookie description --- .../de/cookie-consent-translations.json | 50 ++++++++++++------- .../en/cookie-consent-translations.json | 34 +++++++++---- 2 files changed, 58 insertions(+), 26 deletions(-) diff --git a/src/assets/locales/de/cookie-consent-translations.json b/src/assets/locales/de/cookie-consent-translations.json index 68de689b3..e603dba3b 100644 --- a/src/assets/locales/de/cookie-consent-translations.json +++ b/src/assets/locales/de/cookie-consent-translations.json @@ -1,36 +1,52 @@ { "consentModal": { - "title": "Ihre Datenschutzoptionen", - "description": "Wir verwenden Cookies, um Ihre Erfahrung zu verbessern, den Datenverkehr zu analysieren und personalisierte Inhalte bereitzustellen. Sie können entweder alle Cookies akzeptieren oder Ihre Präferenzen für verschiedene Kategorien verwalten.", + "title": "Ihre Datenschutzeinstellungen", + "description": "Wir verwenden Cookies, um Ihr Erlebnis zu verbessern, den Verkehr zu analysieren und personalisierte Inhalte bereitzustellen. Sie können entweder alle Cookies akzeptieren oder Ihre Präferenzen für verschiedene Kategorien verwalten.", "acceptAllBtn": "Alle Cookies akzeptieren", "acceptNecessaryBtn": "Alle ablehnen", - "showPreferencesBtn": "Cookie-Präferenzen verwalten" + "showPreferencesBtn": "Cookie-Einstellungen verwalten" }, "preferencesModal": { - "title": "Verwalten Sie Ihre Cookie-Präferenzen", + "title": "Verwalten Sie Ihre Cookie-Einstellungen", "acceptAllBtn": "Alle Cookies akzeptieren", "acceptNecessaryBtn": "Alle ablehnen", - "savePreferencesBtn": "Präferenzen speichern", + "savePreferencesBtn": "Einstellungen speichern", "closeIconLabel": "Schließen", "sections": [ { - "title": "Cookie-Nutzung", - "description": "Unsere Website verwendet Cookies, um wesentliche Funktionen sicherzustellen, Ihr Surferlebnis zu verbessern und personalisierte Inhalte bereitzustellen. Einige Cookies sind erforderlich, während andere uns helfen, unsere Dienste zu verbessern." + "title": "Verwendung von Cookies", + "description": "Unsere Website verwendet Cookies, um die wesentliche Funktionalität zu gewährleisten, Ihr Browser-Erlebnis zu verbessern und personalisierte Inhalte bereitzustellen. Einige Cookies sind erforderlich, während andere uns helfen, unsere Dienstleistungen zu verbessern." }, { "title": "Leistungs- und Analyse-Cookies", - "description": "Diese Cookies helfen uns, zu analysieren, wie Besucher mit unserer Website interagieren, und ermöglichen es uns, die Leistung zu messen und zu verbessern. Sie sammeln Informationen in anonymer Form.", - "linkedCategory": "analytics" + "description": "Diese Cookies helfen uns, zu analysieren, wie Besucher mit unserer Website interagieren, und ermöglichen es uns, die Leistung zu messen und zu verbessern. Sie sammeln Informationen in anonymisierter Form.", + "linkedCategory": "analytics", + "cookieTable": { + "headers": { + "name": "Name", + "domain": "Dienst", + "description": "Beschreibung", + "expiration": "Ablauf" + }, + "body": [ + { + "name": "_li_id", + "domain": "Leadinfo.com", + "description": "Datenschutzerklärung von Leadinfo", + "expiration": "_li_id wird für zwei Jahre gespeichert" + }, + { + "name": "_li_ses", + "domain": "Leadinfo.com", + "description": "Datenschutzerklärung von Leadinfo", + "expiration": "_li_ses wird nur für die aktuelle Sitzung verwendet" + } + ] + } }, { - "title": "Funktionalitäts-Cookies", - "description": "Diese Cookies ermöglichen es der Website, sich an Ihre Entscheidungen zu erinnern, wie z.B. Ihren Benutzernamen, die Sprache oder die Region, in der Sie sich befinden, und bieten erweiterte, persönlichere Funktionen.", - "linkedCategory": "functionality" - }, - { - "title": "Zielgerichtete und Werbe-Cookies", - "description": "Diese Cookies können von unseren Werbepartnern über unsere Website gesetzt werden. Sie können verwendet werden, um ein Profil Ihrer Interessen zu erstellen und Ihnen relevante Werbung auf anderen Websites anzuzeigen. Sie speichern keine direkten personenbezogenen Daten, basieren jedoch auf der eindeutigen Identifizierung Ihres Browsers und Ihres Internetgeräts.", - "linkedCategory": "advertising" + "title": "Weitere Informationen", + "description": "Bei Fragen zu unserer Cookie-Richtlinie und Ihren Wahlmöglichkeiten kontaktieren Sie uns bitte über kontaktieren Sie uns." } ] } diff --git a/src/assets/locales/en/cookie-consent-translations.json b/src/assets/locales/en/cookie-consent-translations.json index b1ae55cc0..df0ca1c5a 100644 --- a/src/assets/locales/en/cookie-consent-translations.json +++ b/src/assets/locales/en/cookie-consent-translations.json @@ -20,17 +20,33 @@ { "title": "Performance and Analytics Cookies", "description": "These cookies help us analyze how visitors interact with our website, allowing us to measure and improve performance. They collect information in an anonymous form.", - "linkedCategory": "analytics" + "linkedCategory": "analytics", + "cookieTable": { + "headers": { + "name": "Name", + "domain": "Service", + "description": "Description", + "expiration": "Expiration" + }, + "body": [ + { + "name": "_li_id", + "domain": "Leadinfo.com", + "description": "Privacy statement of Leadinfo", + "expiration": "_li_id will be saved for two years" + }, + { + "name": "_li_ses", + "domain": "Leadinfo.com", + "description": "Privacy statement of Leadinfo", + "expiration": "_li_ses is only used for the current session" + } + ] + } }, { - "title": "Functionality Cookies", - "description": "These cookies allow the website to remember choices you make, such as your username, language, or the region you are in, and provide enhanced, more personal features.", - "linkedCategory": "functionality" - }, - { - "title": "Targeting and Advertising Cookies", - "description": "These cookies may be set through our site by our advertising partners. They may be used to build a profile of your interests and show you relevant ads on other sites. They do not store personal information directly but are based on uniquely identifying your browser and internet device.", - "linkedCategory": "advertising" + "title": "More information", + "description": "For any queries in relation to our policy on cookies and your choices, please contact us." } ] } From 4c654bcbe4c212f9248818445cc8bbbd761497e4 Mon Sep 17 00:00:00 2001 From: ipeke94 <26484292+ipeke94@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:20:39 +0200 Subject: [PATCH 8/9] fix: update cookie description --- .../de/cookie-consent-translations.json | 24 +++++++++---------- .../en/cookie-consent-translations.json | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/assets/locales/de/cookie-consent-translations.json b/src/assets/locales/de/cookie-consent-translations.json index e603dba3b..930af1a95 100644 --- a/src/assets/locales/de/cookie-consent-translations.json +++ b/src/assets/locales/de/cookie-consent-translations.json @@ -1,25 +1,25 @@ { "consentModal": { - "title": "Ihre Datenschutzeinstellungen", - "description": "Wir verwenden Cookies, um Ihr Erlebnis zu verbessern, den Verkehr zu analysieren und personalisierte Inhalte bereitzustellen. Sie können entweder alle Cookies akzeptieren oder Ihre Präferenzen für verschiedene Kategorien verwalten.", + "title": "Ihre Datenschutzoptionen", + "description": "Wir verwenden Cookies, um Ihre Erfahrung zu verbessern, den Datenverkehr zu analysieren und personalisierte Inhalte bereitzustellen. Sie können entweder alle Cookies akzeptieren oder Ihre Präferenzen für verschiedene Kategorien verwalten.", "acceptAllBtn": "Alle Cookies akzeptieren", - "acceptNecessaryBtn": "Alle ablehnen", - "showPreferencesBtn": "Cookie-Einstellungen verwalten" + "acceptNecessaryBtn": "Nur notwendige Cookies akzeptieren", + "showPreferencesBtn": "Cookie-Präferenzen verwalten" }, "preferencesModal": { - "title": "Verwalten Sie Ihre Cookie-Einstellungen", + "title": "Verwalten Sie Ihre Cookie-Präferenzen", "acceptAllBtn": "Alle Cookies akzeptieren", - "acceptNecessaryBtn": "Alle ablehnen", - "savePreferencesBtn": "Einstellungen speichern", + "acceptNecessaryBtn": "Nur notwendige Cookies akzeptieren", + "savePreferencesBtn": "Präferenzen speichern", "closeIconLabel": "Schließen", "sections": [ { "title": "Verwendung von Cookies", - "description": "Unsere Website verwendet Cookies, um die wesentliche Funktionalität zu gewährleisten, Ihr Browser-Erlebnis zu verbessern und personalisierte Inhalte bereitzustellen. Einige Cookies sind erforderlich, während andere uns helfen, unsere Dienstleistungen zu verbessern." + "description": "Unsere Website verwendet Cookies, um wesentliche Funktionen sicherzustellen, Ihr Surferlebnis zu verbessern und personalisierte Inhalte bereitzustellen. Einige Cookies sind erforderlich, während andere uns helfen, unsere Dienste zu verbessern." }, { "title": "Leistungs- und Analyse-Cookies", - "description": "Diese Cookies helfen uns, zu analysieren, wie Besucher mit unserer Website interagieren, und ermöglichen es uns, die Leistung zu messen und zu verbessern. Sie sammeln Informationen in anonymisierter Form.", + "description": "Diese Cookies helfen uns zu analysieren, wie Besucher mit unserer Website interagieren, und ermöglichen es uns, die Leistung zu messen und zu verbessern. Sie sammeln Informationen in anonymer Form.", "linkedCategory": "analytics", "cookieTable": { "headers": { @@ -32,13 +32,13 @@ { "name": "_li_id", "domain": "Leadinfo.com", - "description": "Datenschutzerklärung von Leadinfo", + "description": "Leadinfo platziert zwei Cookies, die Satellytes nur Einblicke in das Verhalten auf der Website geben. Diese Cookies werden nicht mit anderen Parteien geteilt. Datenschutzerklärung von Leadinfo", "expiration": "_li_id wird für zwei Jahre gespeichert" }, { "name": "_li_ses", "domain": "Leadinfo.com", - "description": "Datenschutzerklärung von Leadinfo", + "description": "Leadinfo platziert zwei Cookies, die Satellytes nur Einblicke in das Verhalten auf der Website geben. Diese Cookies werden nicht mit anderen Parteien geteilt. Datenschutzerklärung von Leadinfo", "expiration": "_li_ses wird nur für die aktuelle Sitzung verwendet" } ] @@ -46,7 +46,7 @@ }, { "title": "Weitere Informationen", - "description": "Bei Fragen zu unserer Cookie-Richtlinie und Ihren Wahlmöglichkeiten kontaktieren Sie uns bitte über kontaktieren Sie uns." + "description": "Bei Fragen zu unserer Cookie-Richtlinie oder Ihren Auswahlmöglichkeiten wenden Sie sich bitte an uns." } ] } diff --git a/src/assets/locales/en/cookie-consent-translations.json b/src/assets/locales/en/cookie-consent-translations.json index df0ca1c5a..f6e5a0957 100644 --- a/src/assets/locales/en/cookie-consent-translations.json +++ b/src/assets/locales/en/cookie-consent-translations.json @@ -32,13 +32,13 @@ { "name": "_li_id", "domain": "Leadinfo.com", - "description": "Privacy statement of Leadinfo", + "description": "Leadinfo places two cookies that only provides Satellytes insights into the behaviour on the website. These cookies will not be shared with other parties. Privacy statement of Leadinfo", "expiration": "_li_id will be saved for two years" }, { "name": "_li_ses", "domain": "Leadinfo.com", - "description": "Privacy statement of Leadinfo", + "description": "Leadinfo places two cookies that only provides Satellytes insights into the behaviour on the website. These cookies will not be shared with other parties. Privacy statement of Leadinfo", "expiration": "_li_ses is only used for the current session" } ] From 4a07cf096bbc0a283d23960fe7609954d371a564 Mon Sep 17 00:00:00 2001 From: ipeke94 <26484292+ipeke94@users.noreply.github.com> Date: Wed, 16 Oct 2024 22:48:13 +0200 Subject: [PATCH 9/9] fix: move cookie consent into head --- src/pages/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 32e9689bf..fd4a765b7 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -59,7 +59,6 @@ const IndexPage = ({ data }: PageProps) => { careerHeader={data.careerHeader} blogHeader={data.blogHeader} /> - ); }; @@ -76,6 +75,7 @@ export const Head = ({ data, location }: PageProps) => { locales={data.locales} /> + ); };