Skip to content

Commit

Permalink
Ajoute un event pour suivre les formulaires validés sans recontact (#…
Browse files Browse the repository at this point in the history
…4516)

* feat: ajoute un event pour suivre les formulaires validés sans recontact

* refactor: recap-email-form event
  • Loading branch information
Shamzic authored Aug 12, 2024
1 parent a956764 commit cdd7fb5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions lib/enums/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export enum EventAction {
FormulaireEmailInvalide = "Invalid email form",
FormulaireTelephoneInvalide = "Invalid phone form",
FormulaireValideAvecRecontact = "Formulaire validé avec recontact",
FormulaireValideSansRecontact = "Formulaire validé sans recontact",
Instructions = CTALabel.Instructions,
JeDonneMonAvis = "Je donne mon avis",
Link = "link",
Expand Down
13 changes: 8 additions & 5 deletions src/components/recap-email-and-sms-form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,17 @@ const sendRecap = async (surveyOptin) => {
emailInputErrorMessage.value = true
}
const sendOptinSurveyEvent =
surveyOptin &&
(!phoneInputErrorMessage.value || !emailInputErrorMessage.value)
const hasInputErrorMessage =
phoneInputErrorMessage.value || emailInputErrorMessage.value
if (!hasInputErrorMessage) {
const eventAction = surveyOptin
? EventAction.FormulaireValideAvecRecontact
: EventAction.FormulaireValideSansRecontact
if (sendOptinSurveyEvent) {
StatisticsMixin.methods.sendEventToMatomo(
EventCategory.Followup,
EventAction.FormulaireValideAvecRecontact,
eventAction,
ABTestingService.getValues().CTA_EmailRecontact
)
}
Expand Down

0 comments on commit cdd7fb5

Please sign in to comment.