Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: precision metrics par producteur matomo #505

Merged
merged 2 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
role="button"
type="button"
class="btn btn-tile px-md-0 py-md-4 p-2 d-flex flex-md-column flex-row"
(click)="sendByEmail.emit($event)">
(click)="sendByEmail.emit($event); onSendEmailFromActionButton()">
<span class="ri-circled bg-primary text-light fw-normal">
<span role="img" class="ri-mail-send-line" aria-hidden="true"></span>
</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Optional, Output } from '@angular/core';
import { SourcePresentation } from '@features/cartographie/presenters';
import { MatomoTracker } from 'ngx-matomo';
import { environment } from 'projects/client-application/src/environments/environment';

@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
Expand All @@ -11,13 +13,27 @@ export class BoutonsActionComponent {

@Input() public priseRdv: string | undefined;

@Input() public sources: SourcePresentation[] | undefined;

@Output() public sendByEmail: EventEmitter<MouseEvent> = new EventEmitter<MouseEvent>();

@Output() public openImpressionChoiceModal: EventEmitter<MouseEvent> = new EventEmitter<MouseEvent>();

public constructor(@Optional() private readonly _matomoTracker?: MatomoTracker) {}

public onPrintFromActionButton(): void {
this._matomoTracker?.trackEvent('fiche d茅tail', 'bouton action', `impression fiche`);
if (environment.production) {
this._matomoTracker?.trackEvent('fiche d茅tail', 'bouton action', `impression fiche`);
const sourceLabels = this.sources?.map((source) => source.label).join(', ');
this._matomoTracker?.trackEvent('fiche d茅tail', sourceLabels ?? 'Source inconnue', `bouton action - impression fiche`);
abelkhay marked this conversation as resolved.
Show resolved Hide resolved
}
}

public onSendEmailFromActionButton(): void {
if (environment.production) {
this._matomoTracker?.trackEvent('fiche d茅tail', 'bouton action', `envoyer par email`);
const sourceLabels = this.sources?.map((source) => source.label).join(', ');
this._matomoTracker?.trackEvent('fiche d茅tail', sourceLabels ?? 'Source inconnue', `bouton action - envoyer par email`);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<app-boutons-action
[siteWeb]="lieuMediationNumerique.contact?.site_web"
[priseRdv]="lieuMediationNumerique.prise_rdv"
[sources]="lieuMediationNumerique.source"
(openImpressionChoiceModal)="impressionChoiceModal.control.toggle($event)"
(sendByEmail)="sendByEmailModal.control.toggle($event)"></app-boutons-action>
<div class="p-4 bg-tertiary d-flex align-items-center" *ngIf="lieuMediationNumerique.prive">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { OrientationSheetForm, SendLieuByEmail } from '../../models';
import { FilterPresentation } from '../../../core/presenters';
import { FormGroup } from '@angular/forms';
import { MatomoTracker } from 'ngx-matomo';
import { environment } from 'projects/client-application/src/environments/environment';

@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down Expand Up @@ -55,6 +56,10 @@ export class LieuxMediationNumeriqueDetailsComponent {
};

public onPrintFromBandeau(): void {
this._matomoTracker?.trackEvent('fiche d茅tail', 'bandeau footer', `impression fiche`);
if (environment.production) {
this._matomoTracker?.trackEvent('fiche d茅tail', 'bandeau footer', `impression fiche`);
const sourceLabels = this.lieuMediationNumerique.source?.map((source) => source.label).join(', ');
this._matomoTracker?.trackEvent('fiche d茅tail', sourceLabels ?? 'Source inconnue', 'bandeau footer - impression fiche');
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { MatomoTracker } from 'ngx-matomo';
import { ConditionAcces, LabelNational } from '@gouvfr-anct/lieux-de-mediation-numerique';
import { ASSETS_TOKEN, AssetsConfiguration } from '../../../../../root';
import { labelToDisplayMap, LieuMediationNumeriqueListItemPresentation } from '../../../presenters';
import { environment } from 'projects/client-application/src/environments/environment';

@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down Expand Up @@ -34,7 +35,9 @@ export class LieuMediationNumeriqueListItemComponent {
}

public showDetails(lieu: LieuMediationNumeriqueListItemPresentation): void {
this._matomoTracker?.trackEvent('Fiches', 'D茅but', `Ouverture de fiches - ${lieu.id}`);
if (environment.production) {
this._matomoTracker?.trackEvent('Fiches', 'D茅but', `Ouverture de fiches - ${lieu.id}`);
}
}

public toLabelNom(label: LabelNational): string | undefined {
Expand Down
Loading