-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Améliore le système de tracking (#1009)
* chore: Move hooks to hook folder * feat: Move tracking logic to context, add event saving system * fix: Plausible bug * feat: Improving context * feat: Reset events state when restarting a simulation * feat: Rename context + fix use engine issue * fix: Rebase issues * fix: Bug engine called in `useFunnel` * feat: Move all logic to `useFunnel` * feat: Switch to Matomo context * feat: Move matomo events to dedicated file * feat: Remove useFunnel move parcours test events * chore: Nettoyage * feat: Add track region event * feat: Add event to detect active iframes * feat: Move save events sent logic to redux * chore: Rename Provider * chore: Cancel removal of trackers * chore : Readd other deleted event tracker * fix: Bug + move category event tracker to start button * chore: Rename provider * fix: Remove duplicates * fix: Add missing element in condition * feat: Add again deleted events * fix: Reenable dev tracker * feat: Ajoute un event listener sur body pour discriminer les iframes interagies * fix: revert event label mods + add missing events * fix: corrige catégories évènements * fix: Events format * fix: Issues after rebase * fix: Error after rebase * feat: Update cypress workflow * fix: Oubli tracker * chore: Add missing trans
- Loading branch information
Showing
66 changed files
with
720 additions
and
334 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule nosgestesclimat
updated
from 3c21fa to 27020e
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,190 @@ | ||
import { DottedName } from 'Rules' | ||
|
||
/* | ||
* Matomo events | ||
* https://matomo.org/docs/event-tracking/ | ||
* [ | ||
* 'trackEvent', // Type de l'évènement | ||
* 'Category' (string), // Catégorie de l'évènement à rattacher à son contexte (cf. exemples ci-dessous) | ||
* 'Action' (string), // Action concrête mesurée (clic sur machin, submit de tel truc, etc.) | ||
* 'Name' (string), // Nom de l'évènement (optionnel) si besoin de détailier l'action | ||
* 'Value' (number) // Une valeur numérique (optionnelle) | ||
* ] | ||
*/ | ||
|
||
// Partage | ||
export const getMatomoEventShareMobile = (score: number) => [ | ||
'trackEvent', | ||
'Partage page de fin', | ||
'Clic bouton "Partager mes résultats" sur mobile', | ||
null, | ||
score, | ||
] | ||
export const getMatomoEventShareDesktop = (score: number) => [ | ||
'trackEvent', | ||
'Partage page de fin', | ||
'Clic bouton "Partager mes résultats" sur desktop', | ||
null, | ||
score, | ||
] | ||
|
||
// Formulaire | ||
export const getMatomoEventClickNextQuestion = (currentQuestion: string) => [ | ||
'trackEvent', | ||
'Formulaire', | ||
'Clic bouton "Suivant"', | ||
currentQuestion, | ||
] | ||
export const getMatomoEventClickDontKnow = (currentQuestion: string) => [ | ||
'trackEvent', | ||
'Formulaire', | ||
'Clic bouton "Je ne sais pas"', | ||
currentQuestion, | ||
] | ||
export const getMatomoEventClickHelp = (dottedName: DottedName) => [ | ||
'trackEvent', | ||
'help', | ||
dottedName, | ||
] | ||
export const matomoEventKilometerHelp = [ | ||
'trackEvent', | ||
'Aide saisie km', | ||
'Ajout trajet km voiture', | ||
] | ||
export const matomoEventKilometerHelpClickOpen = [ | ||
'trackEvent', | ||
'Aide saisie km', | ||
'Ouvre aide à la saisie km voiture', | ||
] | ||
export const matomoEventKilometerHelpClickClose = [ | ||
'trackEvent', | ||
'Aide saisie km', | ||
'Ferme aide à la saisie km voiture', | ||
] | ||
export const getMatomoEventAmortissement = (dottedName: DottedName) => [ | ||
'trackEvent', | ||
'Formulaire', | ||
'Utilisation amortissement avion', | ||
dottedName, | ||
] | ||
|
||
// Change Region | ||
export const getMatomoEventChangeRegion = (code: string) => [ | ||
'trackEvent', | ||
'I18N', | ||
'Clic bannière localisation', | ||
code, | ||
] | ||
|
||
// Iframe | ||
export const getMatomoEventVisitViaIframe = (url: string) => [ | ||
'trackEvent', | ||
'iframe', | ||
'visites via iframe', | ||
url, | ||
] | ||
export const matomoEventInteractionIframe = [ | ||
'trackEvent', | ||
'iframe', | ||
'interaction avec iframe', | ||
] | ||
|
||
// Mode groupe | ||
export const matomoEventModeGroupeFiltres = [ | ||
'trackEvent', | ||
'Mode Groupe', | ||
'Ouvre filtres', | ||
] | ||
export const getMatomoEventModeGroupeRealtimeActivation = ( | ||
isRealTime: boolean | ||
) => [ | ||
'trackEvent', | ||
'Mode Groupe', | ||
isRealTime | ||
? 'Désactivation du mode temps réel' | ||
: 'Activation du mode temps réel', | ||
] | ||
export const getMatomoEventModeGroupeRoomCreation = (mode: string) => [ | ||
'trackEvent', | ||
'Mode Groupe', | ||
'Création salle', | ||
mode, | ||
] | ||
export const matomoEventModeGroupeCTAStart = [ | ||
'trackEvent', | ||
'Mode Groupe', | ||
'Clic CTA accueil', | ||
] | ||
|
||
// Funnel | ||
export const matomoEventParcoursTestStart = [ | ||
'trackEvent', | ||
'NGC', | ||
'Clic CTA accueil', | ||
] | ||
export const matomoEventParcoursTestReprendre = [ | ||
'trackEvent', | ||
'NGC', | ||
'Clic CTA accueil : Reprendre mon test', | ||
] | ||
export const getMatomoEventParcoursTestTutorialProgress = ( | ||
last: boolean, | ||
index: number | ||
) => ['trackEvent', 'testIntro', last ? 'Terminer' : `diapo ${index} passée`] | ||
export const matomoEventParcoursTestSkipTutorial = [ | ||
'trackEvent', | ||
'testIntro', | ||
'tuto passé', | ||
] | ||
export const matomoEventFirstAnswer = [ | ||
'trackEvent', | ||
'NGC', | ||
'1ère réponse au bilan', | ||
] | ||
export const getMatomoEventParcoursTestCategoryStarted = (category: string) => [ | ||
'trackEvent', | ||
'NGC', | ||
'Catégorie démarrée', | ||
category, | ||
] | ||
export const matomoEvent50PercentProgress = [ | ||
'trackEvent', | ||
'NGC', | ||
'Progress > 50%', | ||
] | ||
export const matomoEvent90PercentProgress = [ | ||
'trackEvent', | ||
'NGC', | ||
'Progress > 90%', | ||
] | ||
export const getMatomoEventParcoursTestOver = (bilan: number | undefined) => [ | ||
'trackEvent', | ||
'NGC', | ||
'A terminé la simulation', | ||
null, | ||
bilan || '', | ||
] | ||
export const matomoEventClickBanner = [ | ||
'trackEvent', | ||
'NGC', | ||
'Clic explication score', | ||
] | ||
export const matomoEventSwipeEndPage = [ | ||
'trackEvent', | ||
'NGC', | ||
'Swipe page de fin', | ||
] | ||
export const getMatomoEventClickActionButtonEndPage = ( | ||
score: string | number | ||
) => ['trackEvent', 'NGC', 'Clic bouton action page /fin', null, score] | ||
|
||
// Actions | ||
export const getMatomoEventActionRejected = ( | ||
dottedName: DottedName, | ||
nodeValue: string | ||
) => ['trackEvent', '/actions', 'Action rejetée', dottedName, nodeValue] | ||
|
||
export const getMatomoEventActionAccepted = ( | ||
dottedName: DottedName, | ||
nodeValue: string | ||
) => ['trackEvent', '/actions', 'Action sélectionnée', dottedName, nodeValue] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.