From 167fb96712dd90c44a539d8cf11027dadfd23c62 Mon Sep 17 00:00:00 2001 From: Alice Dahan Date: Thu, 9 Jan 2025 13:27:27 +0100 Subject: [PATCH] chore(piano-analytics): corrige les privacy modes --- .../components/ATInternetTracking/Tracker.ts | 14 +++++++------- .../components/layout/Footer/PrivacyPolicy.tsx | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/site/source/components/ATInternetTracking/Tracker.ts b/site/source/components/ATInternetTracking/Tracker.ts index 8b86f93d0..914fbb7c9 100644 --- a/site/source/components/ATInternetTracking/Tracker.ts +++ b/site/source/components/ATInternetTracking/Tracker.ts @@ -23,7 +23,7 @@ export interface ATTracker { setConfigurations(options: { site: number collectDomain: string - privacyDefaultMode: 'optout' | 'exempt' + privacyDefaultMode: 'opt-out' | 'essential' }): void setProperties( @@ -48,8 +48,8 @@ export interface ATTracker { ): void consent: { - setMode(type: 'exempt' | 'optout'): void - getMode(): { name: 'exempt' | 'optout' } + setMode(type: 'essential' | 'opt-out'): void + getMode(): { name: 'essential' | 'opt-out' } } } @@ -68,7 +68,7 @@ export function createTracker(siteId?: string, doNotTrack = false) { window.pa.setConfigurations({ site, collectDomain: 'https://tm.urssaf.fr', - privacyDefaultMode: doNotTrack ? 'optout' : 'exempt', + privacyDefaultMode: doNotTrack ? 'opt-out' : 'essential', }) window.pa.setProperties( @@ -87,7 +87,7 @@ export function createTracker(siteId?: string, doNotTrack = false) { setConfigurations(options: { site: number collectDomain: string - privacyDefaultMode: 'exempt' + privacyDefaultMode: 'essential' }): void { window.pa.setConfigurations(options) } @@ -120,10 +120,10 @@ export function createTracker(siteId?: string, doNotTrack = false) { } consent = { - setMode(type: 'exempt' | 'optout'): void { + setMode(type: 'essential' | 'opt-out'): void { window.pa.consent.setMode(type) }, - getMode(): { name: 'exempt' | 'optout' } { + getMode(): { name: 'essential' | 'opt-out' } { return window.pa.consent.getMode() }, } diff --git a/site/source/components/layout/Footer/PrivacyPolicy.tsx b/site/source/components/layout/Footer/PrivacyPolicy.tsx index db44878e4..2aa144a07 100644 --- a/site/source/components/layout/Footer/PrivacyPolicy.tsx +++ b/site/source/components/layout/Footer/PrivacyPolicy.tsx @@ -42,10 +42,10 @@ export default function PrivacyPolicy({ const handleChange = useCallback( (checked: boolean) => { if (checked) { - tracker?.consent.setMode('optout') + tracker?.consent.setMode('opt-out') safeLocalStorage.setItem('tracking:do_not_track', '1') } else { - tracker?.consent.setMode('exempt') + tracker?.consent.setMode('essential') safeLocalStorage.setItem('tracking:do_not_track', '0') } setValueChanged(true) @@ -302,7 +302,7 @@ export default function PrivacyPolicy({ {t( 'privacyPolicy.tracking.optOut.checkboxLabel',