From 23f8f744bd053194682196f9fabebe70256e231c Mon Sep 17 00:00:00 2001 From: Matthieu Bollot Date: Mon, 22 Jul 2024 11:35:14 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Feat(owner):=20add=20matomo=20event?= =?UTF-8?q?s=20on=20property?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- owner/src/components/Dashboard.vue | 2 ++ .../src/components/property/ConsultProperty.vue | 17 +++++++++++++++-- .../src/components/property/PropertyAddress.vue | 2 ++ .../components/property/PropertyFurniture.vue | 2 ++ .../components/property/PropertyLivingSpace.vue | 2 ++ owner/src/components/property/PropertyName.vue | 2 ++ owner/src/components/property/PropertyRent.vue | 2 ++ owner/src/components/property/PropertyType.vue | 2 ++ owner/src/services/AnalyticsService.ts | 8 ++++---- 9 files changed, 33 insertions(+), 6 deletions(-) diff --git a/owner/src/components/Dashboard.vue b/owner/src/components/Dashboard.vue index fbce61b55..dae69a77f 100644 --- a/owner/src/components/Dashboard.vue +++ b/owner/src/components/Dashboard.vue @@ -9,6 +9,7 @@ import UtilsService from "../services/UtilsService"; import useOwnerStore from "../store/owner-store"; import GmbiAd from "./GmbiAd.vue"; import FeedbackRequest from "./FeedbackRequest.vue"; +import AnalyticsService from "../services/AnalyticsService"; const store = useOwnerStore(); const { t } = useI18n(); @@ -23,6 +24,7 @@ function addProperty() { } function consultProperty(id: number) { + AnalyticsService.propertyData('visit'); router.push({ name: "ConsultProperty", params: { id } }); } diff --git a/owner/src/components/property/ConsultProperty.vue b/owner/src/components/property/ConsultProperty.vue index 001aca8b5..4d4a26c6a 100644 --- a/owner/src/components/property/ConsultProperty.vue +++ b/owner/src/components/property/ConsultProperty.vue @@ -19,6 +19,7 @@ @@ -55,7 +56,7 @@ @@ -292,6 +293,10 @@ function getTenants(): Applicant[] { }); } +function shareBtnClicked() { + AnalyticsService.propertyData('partager'); +} + onMounted(async () => { if (route.params.id) { id.value = Number(route.params.id); @@ -326,6 +331,7 @@ const titleKey = computed(() => { }); function editProperty() { + AnalyticsService.propertyData('modifier'); router.push({ name: 'PropertyName', params: { id: id.value } }); } @@ -338,13 +344,20 @@ function sortTable(col: string) { } } +function showDeletePropertyModal() { + confirmDeleteProperty.value = true; + AnalyticsService.propertyData('supprimer'); +} + function validDeleteFile() { + AnalyticsService.propertyData('supprimer_valider'); store.deleteProperty(id.value).then(() => { router.push({ name: 'Dashboard' }); }); confirmDeleteProperty.value = false; } function undoDeleteFile() { + AnalyticsService.propertyData('supprimer_annuler'); confirmDeleteProperty.value = false; } function validDeleteApplicants() { @@ -360,7 +373,7 @@ function undoDeleteApplicants() { } function copyToken() { - AnalyticsService.copyLink(); + AnalyticsService.propertyData("partager_copylink"); navigator.clipboard.writeText(token.value); toast.success(t('consultproperty.link-copied').toString(), { timeout: 7000, diff --git a/owner/src/components/property/PropertyAddress.vue b/owner/src/components/property/PropertyAddress.vue index bf1d68f75..df2e7d78c 100644 --- a/owner/src/components/property/PropertyAddress.vue +++ b/owner/src/components/property/PropertyAddress.vue @@ -8,6 +8,7 @@ import NakedCard from 'df-shared-next/src/components/NakedCard.vue'; import UtilsService from '../../services/UtilsService'; import PropertyPage from './PropertyPage.vue'; import useOwnerStore from '../../store/owner-store'; +import AnalyticsService from '../../services/AnalyticsService'; const { t } = useI18n(); @@ -43,6 +44,7 @@ const address = computed({ }); function onSubmit() { + AnalyticsService.propertyData('adresse_register'); store.saveProperty().then(() => { router.push({ name: 'PropertyFurniture', diff --git a/owner/src/components/property/PropertyFurniture.vue b/owner/src/components/property/PropertyFurniture.vue index 865de425a..16f527a96 100644 --- a/owner/src/components/property/PropertyFurniture.vue +++ b/owner/src/components/property/PropertyFurniture.vue @@ -6,6 +6,7 @@ import { Field, ErrorMessage } from 'vee-validate'; import NakedCard from 'df-shared-next/src/components/NakedCard.vue'; import PropertyPage from './PropertyPage.vue'; import useOwnerStore from '../../store/owner-store'; +import AnalyticsService from '../../services/AnalyticsService'; const { t } = useI18n(); @@ -29,6 +30,7 @@ const furniture = computed({ }); function onSubmit() { + AnalyticsService.propertyData('ameublement_register'); store.saveProperty().then((data) => { router.push({ name: 'PropertyLivingSpace', params: { id: data.id } }); }); diff --git a/owner/src/components/property/PropertyLivingSpace.vue b/owner/src/components/property/PropertyLivingSpace.vue index 2c2a3f24f..806a3b004 100644 --- a/owner/src/components/property/PropertyLivingSpace.vue +++ b/owner/src/components/property/PropertyLivingSpace.vue @@ -6,6 +6,7 @@ import { useI18n } from 'vue-i18n'; import { useRoute, useRouter } from 'vue-router'; import useOwnerStore from '../../store/owner-store'; import PropertyPage from './PropertyPage.vue'; +import AnalyticsService from '../../services/AnalyticsService'; const { t } = useI18n(); @@ -29,6 +30,7 @@ const livingSpace = computed({ }); function onSubmit() { + AnalyticsService.propertyData('surface_register'); store.saveProperty().then(() => { router.push({ name: 'PropertyRent', params: { id: store.getPropertyToEdit.id } }); }); diff --git a/owner/src/components/property/PropertyName.vue b/owner/src/components/property/PropertyName.vue index 3dafd4838..d7af72f45 100644 --- a/owner/src/components/property/PropertyName.vue +++ b/owner/src/components/property/PropertyName.vue @@ -6,6 +6,7 @@ import { useI18n } from 'vue-i18n'; import { useRoute, useRouter } from 'vue-router'; import useOwnerStore from '../../store/owner-store'; import PropertyPage from './PropertyPage.vue'; +import AnalyticsService from '../../services/AnalyticsService'; const { t } = useI18n(); @@ -29,6 +30,7 @@ const name = computed({ }); function onSubmit() { + AnalyticsService.propertyData('nom_register'); store.saveProperty().then((data) => { router.push({ name: 'PropertyType', params: { id: data.id } }); }); diff --git a/owner/src/components/property/PropertyRent.vue b/owner/src/components/property/PropertyRent.vue index 1521e236d..8649eece4 100644 --- a/owner/src/components/property/PropertyRent.vue +++ b/owner/src/components/property/PropertyRent.vue @@ -6,6 +6,7 @@ import { useI18n } from 'vue-i18n'; import { useRoute, useRouter } from 'vue-router'; import useOwnerStore from '../../store/owner-store'; import PropertyPage from './PropertyPage.vue'; +import AnalyticsService from '../../services/AnalyticsService'; const { t } = useI18n(); @@ -38,6 +39,7 @@ const charges = computed({ }); function onSubmit() { + AnalyticsService.propertyData('honor_declaration_validate'); store.saveProperty().then(() => { router.push({ name: 'PropertyDiagnostic', params: { id: store.getPropertyToEdit.id } }); }); diff --git a/owner/src/components/property/PropertyType.vue b/owner/src/components/property/PropertyType.vue index 476d76458..929d31b90 100644 --- a/owner/src/components/property/PropertyType.vue +++ b/owner/src/components/property/PropertyType.vue @@ -6,6 +6,7 @@ import { useRoute, useRouter } from 'vue-router'; import { Field, ErrorMessage } from 'vee-validate'; import PropertyPage from './PropertyPage.vue'; import useOwnerStore from '../../store/owner-store'; +import AnalyticsService from '../../services/AnalyticsService'; const { t } = useI18n(); @@ -29,6 +30,7 @@ const type = computed({ }); function onSubmit() { + AnalyticsService.propertyData('type_register'); store.saveProperty().then((data) => { router.push({ name: 'PropertyAddress', params: { id: data.id } }); }); diff --git a/owner/src/services/AnalyticsService.ts b/owner/src/services/AnalyticsService.ts index 2b2391af2..70295b948 100644 --- a/owner/src/services/AnalyticsService.ts +++ b/owner/src/services/AnalyticsService.ts @@ -40,11 +40,11 @@ const AnalyticsService = { event_category: 'owner', }); }, - copyLink() { - this.sendEvent('copy-link', { + propertyData(data: string) { + this.sendEvent('property_' + data, { event_category: 'property', - }); - }, + }) + } }; export default AnalyticsService;