From 9cb4ccad0df39dacbda7e9479a010933cdd7a966 Mon Sep 17 00:00:00 2001 From: Geoffroy Begouaussel Date: Mon, 18 Nov 2024 16:39:27 +0100 Subject: [PATCH] feat(mon-pix): add results-page matomo metrics --- .../custom-organization-block.gjs | 26 +++++++++ .../results/evaluation-results-hero/index.gjs | 49 ++++++++++++++-- .../retry-or-reset-block.gjs | 56 +++++++++++++++++++ .../results-details/index.gjs | 14 +++++ .../evaluation-results-tabs/rewards/index.gjs | 14 +++++ .../evaluation-results-tabs/trainings.gjs | 19 +++++++ .../results/hero/retry-or-reset-block-test.js | 11 +++- 7 files changed, 183 insertions(+), 6 deletions(-) diff --git a/mon-pix/app/components/campaigns/assessment/results/evaluation-results-hero/custom-organization-block.gjs b/mon-pix/app/components/campaigns/assessment/results/evaluation-results-hero/custom-organization-block.gjs index 9d854b6e5e6..3f16e5b8c4e 100644 --- a/mon-pix/app/components/campaigns/assessment/results/evaluation-results-hero/custom-organization-block.gjs +++ b/mon-pix/app/components/campaigns/assessment/results/evaluation-results-hero/custom-organization-block.gjs @@ -1,10 +1,14 @@ import PixButtonLink from '@1024pix/pix-ui/components/pix-button-link'; +import { action } from '@ember/object'; +import { inject as service } from '@ember/service'; import Component from '@glimmer/component'; import { t } from 'ember-intl'; import MarkdownToHtml from '../../../../markdown-to-html'; export default class EvaluationResultsCustomOrganizationBlock extends Component { + @service metrics; + get customButtonUrl() { if (this.args.campaign.customResultPageButtonUrl && this.args.campaign.customResultPageButtonText) { const params = {}; @@ -21,6 +25,26 @@ export default class EvaluationResultsCustomOrganizationBlock extends Component } } + @action + handleCustomButtonDisplay() { + this.metrics.add({ + event: 'custom-event', + 'pix-event-category': 'Fin de parcours', + 'pix-event-action': "Affichage du bloc de l'organisation", + 'pix-event-name': 'Présence d’un bouton comportant un lien externe', + }); + } + + @action + handleCustomButtonClick() { + this.metrics.add({ + event: 'custom-event', + 'pix-event-category': 'Fin de parcours', + 'pix-event-action': "Affichage du bloc de l'organisation", + 'pix-event-name': 'Clic sur le lien externe', + }); + } +