chore(piano-analytics): corrige les privacy modes

pull/3201/head
Alice Dahan 2025-01-09 13:27:27 +01:00 committed by liliced
parent e77565ca24
commit 167fb96712
2 changed files with 10 additions and 10 deletions

View File

@ -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()
},
}

View File

@ -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({
<Checkbox
name="opt-out mesure audience"
onChange={handleChange}
defaultSelected={tracker?.consent.getMode().name === 'optout'}
defaultSelected={tracker?.consent.getMode().name === 'opt-out'}
>
{t(
'privacyPolicy.tracking.optOut.checkboxLabel',