|
|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div v-if="layoutStore.isCookieConsentDialogVisible">
|
|
|
- <div class="cookie-consent-banner">
|
|
|
+ <div v-if="!showCustomizationOptions" class="cookie-consent-banner">
|
|
|
<div class="continue-wrapper">
|
|
|
<a class="continue" href="#" @click.prevent="continueWithoutAccepting">
|
|
|
Continuer sans accepter
|
|
|
@@ -52,6 +52,7 @@
|
|
|
<!-- <button class="decline-button" @click="declineCookies">Refuser</button> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
<v-dialog v-model="showCustomizationOptions" persistent max-width="600px">
|
|
|
<v-card>
|
|
|
<v-row class="headline">
|
|
|
@@ -89,53 +90,90 @@
|
|
|
<v-row align="center">
|
|
|
<v-col cols="auto">
|
|
|
<v-switch
|
|
|
- v-model="cookiesPreferences.allowGoogleAnalytics"
|
|
|
- label="Google Analytics"
|
|
|
+ v-model="cookiesPreferences.analyticsConsent"
|
|
|
+ label="Mesure d'audience"
|
|
|
hide-details
|
|
|
color="green"
|
|
|
inset
|
|
|
/>
|
|
|
</v-col>
|
|
|
<v-col>{{
|
|
|
- cookiesPreferences.allowGoogleAnalytics
|
|
|
- ? 'Autorisé'
|
|
|
- : 'Non-autorisé'
|
|
|
+ cookiesPreferences.analyticsConsent ? 'Autorisé' : 'Non-autorisé'
|
|
|
}}</v-col>
|
|
|
</v-row>
|
|
|
<p>
|
|
|
Ces cookies nous permettent d'établir des statistiques, des volumes
|
|
|
de fréquentation et d'utilisation des divers éléments de notre site,
|
|
|
- nous permettant d’optimiser son fonctionnement. Lien vers la
|
|
|
- Politique de protection des données de Google Analytics :
|
|
|
- <a href="https://policies.google.com/">
|
|
|
- https://policies.google.com/</a
|
|
|
- >
|
|
|
+ nous permettant d’optimiser son fonctionnement.
|
|
|
</p>
|
|
|
+
|
|
|
<h4 class="mt-6">Des cookies tiers à visée publicitaire</h4>
|
|
|
|
|
|
<v-row align="center">
|
|
|
<v-col cols="auto">
|
|
|
<v-switch
|
|
|
- v-model="cookiesPreferences.allowMetaPixel"
|
|
|
- label="Meta Pixel"
|
|
|
+ v-model="cookiesPreferences.advertisingConsent"
|
|
|
+ label="Suivi publicitaire"
|
|
|
+ hide-details
|
|
|
+ color="green"
|
|
|
+ inset
|
|
|
+ />
|
|
|
+ </v-col>
|
|
|
+ <v-col>{{
|
|
|
+ cookiesPreferences.advertisingConsent
|
|
|
+ ? 'Autorisé'
|
|
|
+ : 'Non-autorisé'
|
|
|
+ }}</v-col>
|
|
|
+ </v-row>
|
|
|
+ <p>
|
|
|
+ Autoriser le stockage et l'accès aux cookies pour diffuser des
|
|
|
+ annonces publicitaires personnalisées. Cela permet de vous montrer
|
|
|
+ des publicités plus pertinentes.
|
|
|
+ </p>
|
|
|
+
|
|
|
+ <v-row align="center">
|
|
|
+ <v-col cols="auto">
|
|
|
+ <v-switch
|
|
|
+ v-model="cookiesPreferences.adUserDataConsent"
|
|
|
+ label="Données Utilisateur pour la Publicité"
|
|
|
hide-details
|
|
|
color="green"
|
|
|
inset
|
|
|
/>
|
|
|
</v-col>
|
|
|
<v-col>{{
|
|
|
- cookiesPreferences.allowMetaPixel ? 'Autorisé' : 'Non-autorisé'
|
|
|
+ cookiesPreferences.advertisingConsent
|
|
|
+ ? 'Autorisé'
|
|
|
+ : 'Non-autorisé'
|
|
|
}}</v-col>
|
|
|
</v-row>
|
|
|
<p>
|
|
|
- Ces cookies sont installés par Facebook. Ce service nous permet
|
|
|
- d'établir des statistiques de consultation des publicités. Lien vers
|
|
|
- la Politique de protection des données de Facebook Pixel :
|
|
|
- <a
|
|
|
- href="https://www.facebook.com/privacy/policies/cookies/?entry_point=cookie_policy_redirect&entry=0"
|
|
|
- >
|
|
|
- https://www.facebook.com/privacy/policies/cookies/?entry_point=cookie_policy_redirect&entry=0
|
|
|
- </a>
|
|
|
+ Autoriser la collecte et l'utilisation de vos données personnelles
|
|
|
+ (comme votre adresse e-mail ou numéro de téléphone) pour créer des
|
|
|
+ profils de publicité personnalisés et améliorer le ciblage des
|
|
|
+ annonces.
|
|
|
+ </p>
|
|
|
+
|
|
|
+ <v-row align="center">
|
|
|
+ <v-col cols="auto">
|
|
|
+ <v-switch
|
|
|
+ v-model="cookiesPreferences.adPersonalizationConsent"
|
|
|
+ label="Personnalisation des annonces"
|
|
|
+ hide-details
|
|
|
+ color="green"
|
|
|
+ inset
|
|
|
+ />
|
|
|
+ </v-col>
|
|
|
+ <v-col>{{
|
|
|
+ cookiesPreferences.advertisingConsent
|
|
|
+ ? 'Autorisé'
|
|
|
+ : 'Non-autorisé'
|
|
|
+ }}</v-col>
|
|
|
+ </v-row>
|
|
|
+ <p>
|
|
|
+ Autoriser la personnalisation des annonces en fonction de vos
|
|
|
+ préférences et de votre comportement de navigation pour vous offrir
|
|
|
+ des publicités plus pertinentes et ciblées.
|
|
|
</p>
|
|
|
</v-card-text>
|
|
|
|
|
|
@@ -172,7 +210,6 @@
|
|
|
<script setup lang="ts">
|
|
|
import { onMounted, type Ref, ref } from 'vue'
|
|
|
import { useCookies } from 'vue3-cookies'
|
|
|
-import CookieManager from '~/services/CookieManager'
|
|
|
import { COOKIE_CONSENT_CHOICE } from '~/types/enum/enums'
|
|
|
import type { CookiesPreferences } from '~/types/interface'
|
|
|
|
|
|
@@ -182,12 +219,16 @@ const { cookies } = useCookies()
|
|
|
const showCustomizationOptions = ref(false)
|
|
|
const showNotification = ref(false)
|
|
|
|
|
|
+const { gtag } = useGtag()
|
|
|
+
|
|
|
/**
|
|
|
* Cookies options
|
|
|
*/
|
|
|
const cookiesPreferences: Ref<CookiesPreferences> = ref({
|
|
|
- allowGoogleAnalytics: true,
|
|
|
- allowMetaPixel: true,
|
|
|
+ analyticsConsent: true,
|
|
|
+ advertisingConsent: true,
|
|
|
+ adUserDataConsent: true,
|
|
|
+ adPersonalizationConsent: true,
|
|
|
})
|
|
|
|
|
|
const showPopup = () => {
|
|
|
@@ -204,58 +245,72 @@ const notify = () => {
|
|
|
showNotification.value = true
|
|
|
|
|
|
// Hide the notification after 1 minute
|
|
|
- // setTimeout(() => {
|
|
|
- // showNotification.value = false
|
|
|
- // }, 60000)
|
|
|
+ setTimeout(() => {
|
|
|
+ showNotification.value = false
|
|
|
+ }, 60000)
|
|
|
}
|
|
|
|
|
|
const setupCookies = (
|
|
|
choice: COOKIE_CONSENT_CHOICE,
|
|
|
- allowGoogleAnalytics: boolean,
|
|
|
- allowMetaPixel: boolean,
|
|
|
+ analyticsConsent: boolean,
|
|
|
+ advertisingConsent: boolean,
|
|
|
+ adUserDataConsent: boolean,
|
|
|
+ adPersonalizationConsent: boolean,
|
|
|
duration: number = 365
|
|
|
) => {
|
|
|
cookies.set('cookie_consent', choice, duration + 'd')
|
|
|
|
|
|
- cookiesPreferences.value.allowGoogleAnalytics = allowGoogleAnalytics
|
|
|
- cookies.set('ga_consent', allowGoogleAnalytics.toString(), duration + 'd')
|
|
|
- if (allowGoogleAnalytics) {
|
|
|
- CookieManager.makeGoogleAnalyticsCookies('UA-XXXXX-Y')
|
|
|
- } else {
|
|
|
- purgeGoogleCookies()
|
|
|
- }
|
|
|
+ cookiesPreferences.value.analyticsConsent = analyticsConsent
|
|
|
+ cookies.set('analytics_consent', analyticsConsent.toString(), duration + 'd')
|
|
|
|
|
|
- cookiesPreferences.value.allowMetaPixel = allowMetaPixel
|
|
|
- cookies.set('mp_consent', allowMetaPixel.toString(), duration + 'd')
|
|
|
- if (allowMetaPixel) {
|
|
|
- CookieManager.makeMetaPixelCookies('1045498113172655')
|
|
|
- } else {
|
|
|
- purgeMetaCookies()
|
|
|
- }
|
|
|
+ cookiesPreferences.value.advertisingConsent = advertisingConsent
|
|
|
+ cookies.set(
|
|
|
+ 'advertising_consent',
|
|
|
+ advertisingConsent.toString(),
|
|
|
+ duration + 'd'
|
|
|
+ )
|
|
|
+
|
|
|
+ cookiesPreferences.value.adUserDataConsent = adUserDataConsent
|
|
|
+ cookies.set(
|
|
|
+ 'ad_user_data_consent',
|
|
|
+ adUserDataConsent.toString(),
|
|
|
+ duration + 'd'
|
|
|
+ )
|
|
|
+
|
|
|
+ cookiesPreferences.value.adPersonalizationConsent = adPersonalizationConsent
|
|
|
+ cookies.set(
|
|
|
+ 'ad_personalization_consent',
|
|
|
+ adPersonalizationConsent.toString(),
|
|
|
+ duration + 'd'
|
|
|
+ )
|
|
|
+
|
|
|
+ gtag('consent', 'update', {
|
|
|
+ analytics_storage: analyticsConsent ? 'granted' : 'denied',
|
|
|
+ ad_storage: analyticsConsent ? 'granted' : 'denied',
|
|
|
+ ad_user_data: adUserDataConsent ? 'granted' : 'denied',
|
|
|
+ ad_personalization: adPersonalizationConsent ? 'granted' : 'denied',
|
|
|
+ })
|
|
|
|
|
|
// Store consent date and status
|
|
|
localStorage.setItem(
|
|
|
'cookie_consent',
|
|
|
JSON.stringify({
|
|
|
date: new Date(),
|
|
|
- consent: { allowGoogleAnalytics, allowMetaPixel },
|
|
|
+ consent: {
|
|
|
+ analyticsConsent,
|
|
|
+ advertisingConsent,
|
|
|
+ adUserDataConsent,
|
|
|
+ adPersonalizationConsent,
|
|
|
+ },
|
|
|
})
|
|
|
)
|
|
|
}
|
|
|
|
|
|
-const purgeGoogleCookies = () => {
|
|
|
- cookies.remove('google') // TODO: complete
|
|
|
-}
|
|
|
-
|
|
|
-const purgeMetaCookies = () => {
|
|
|
- cookies.remove('google') // TODO: complete
|
|
|
-}
|
|
|
-
|
|
|
/**
|
|
|
* Accept and setup all the cookies and close the popup
|
|
|
*/
|
|
|
const acceptAllCookies = () => {
|
|
|
- setupCookies(COOKIE_CONSENT_CHOICE.ACCEPTED, true, true)
|
|
|
+ setupCookies(COOKIE_CONSENT_CHOICE.ACCEPTED, true, true, true, true)
|
|
|
closePopup()
|
|
|
}
|
|
|
|
|
|
@@ -263,7 +318,7 @@ const acceptAllCookies = () => {
|
|
|
* Refuse all the cookies, set up the cookie_consent cookie and close the popup
|
|
|
*/
|
|
|
const declineCookies = () => {
|
|
|
- setupCookies(COOKIE_CONSENT_CHOICE.DECLINED, false, false, 7)
|
|
|
+ setupCookies(COOKIE_CONSENT_CHOICE.DECLINED, false, false, false, false, 7)
|
|
|
notify()
|
|
|
closePopup()
|
|
|
}
|
|
|
@@ -274,8 +329,10 @@ const declineCookies = () => {
|
|
|
const saveCookiesPreferences = () => {
|
|
|
setupCookies(
|
|
|
COOKIE_CONSENT_CHOICE.CUSTOMIZED,
|
|
|
- cookiesPreferences.value.allowGoogleAnalytics,
|
|
|
- cookiesPreferences.value.allowMetaPixel
|
|
|
+ cookiesPreferences.value.analyticsConsent,
|
|
|
+ cookiesPreferences.value.advertisingConsent,
|
|
|
+ cookiesPreferences.value.adUserDataConsent,
|
|
|
+ cookiesPreferences.value.adPersonalizationConsent
|
|
|
)
|
|
|
closePopup()
|
|
|
}
|
|
|
@@ -288,9 +345,14 @@ const continueWithoutAccepting = () => {
|
|
|
}
|
|
|
|
|
|
const loadActivePreferences = () => {
|
|
|
- cookiesPreferences.value.allowGoogleAnalytics =
|
|
|
- cookies.get('ga_consent') === 'true'
|
|
|
- cookiesPreferences.value.allowMetaPixel = cookies.get('mp_consent') === 'true'
|
|
|
+ cookiesPreferences.value.analyticsConsent =
|
|
|
+ cookies.get('analytics_consent') !== 'false'
|
|
|
+ cookiesPreferences.value.advertisingConsent =
|
|
|
+ cookies.get('advertising_consent') !== 'false'
|
|
|
+ cookiesPreferences.value.adUserDataConsent =
|
|
|
+ cookies.get('ad_user_data_consent') !== 'false'
|
|
|
+ cookiesPreferences.value.adPersonalizationConsent =
|
|
|
+ cookies.get('ad_personalization_consent') !== 'false'
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -422,7 +484,7 @@ onMounted(() => {
|
|
|
.custom-switch,
|
|
|
.v-input--selection-controls__input,
|
|
|
input:checked,
|
|
|
-+ .v-input--selection-controls__ripple,
|
|
|
+.v-input--selection-controls__ripple,
|
|
|
.v-ripple__container {
|
|
|
background-color: var(--v-primary-darken4);
|
|
|
}
|
|
|
@@ -430,7 +492,7 @@ input:checked,
|
|
|
.custom-switch,
|
|
|
.v-input--selection-controls__input,
|
|
|
input:checked,
|
|
|
-+ .v-input--selection-controls__ripple,
|
|
|
+.v-input--selection-controls__ripple,
|
|
|
.v-ripple__container,
|
|
|
.v-ripple__animation {
|
|
|
background-color: var(--v-primary-darken4);
|