From 73ffe6005232345ef142eadecdf9504823e74709 Mon Sep 17 00:00:00 2001 From: vhhoang-axonivy Date: Fri, 29 Nov 2024 10:54:24 +0700 Subject: [PATCH] Bring back Matomo tracking code (#245) Co-authored-by: Hoang Vu Huy --- marketplace-ui/src/app/app.config.ts | 15 ++++++++------- .../product-detail-version-action.component.html | 12 ++++++++++++ .../product-detail-version-action.component.ts | 2 ++ .../product-filter/product-filter.component.html | 6 +++++- .../product-filter/product-filter.component.ts | 3 ++- .../src/environments/environment.development.ts | 5 ++--- .../src/environments/environment.staging.ts | 5 ++--- marketplace-ui/src/environments/environment.ts | 5 ++--- 8 files changed, 35 insertions(+), 18 deletions(-) diff --git a/marketplace-ui/src/app/app.config.ts b/marketplace-ui/src/app/app.config.ts index 2b8b2a52..262cf8a0 100644 --- a/marketplace-ui/src/app/app.config.ts +++ b/marketplace-ui/src/app/app.config.ts @@ -7,6 +7,8 @@ import { MARKED_OPTIONS, MarkdownModule } from 'ngx-markdown'; import { markedOptionsFactory } from './core/configs/markdown.config'; import { httpLoaderFactory } from './core/configs/translate.config'; import { apiInterceptor } from './core/interceptors/api.interceptor'; +import { provideMatomo, withRouter } from 'ngx-matomo-client'; +import { environment } from '../environments/environment'; const scrollConfig: InMemoryScrollingOptions = { scrollPositionRestoration: 'disabled', @@ -22,13 +24,12 @@ export const appConfig: ApplicationConfig = { provideRouter(routes, inMemoryScrollingFeature), provideHttpClient(withFetch(), withInterceptors([apiInterceptor])), - // Disabled for later HTTPS implementation - // provideMatomo({ - // siteId: environment.matomoSiteId, - // trackerUrl: environment.matomoTrackerUrl, - // }, - // withRouter(), - // ), + provideMatomo({ + siteId: environment.matomoSiteId, + trackerUrl: environment.matomoTrackerUrl, + }, + withRouter(), + ), importProvidersFrom( TranslateModule.forRoot({ loader: { diff --git a/marketplace-ui/src/app/modules/product/product-detail/product-detail-version-action/product-detail-version-action.component.html b/marketplace-ui/src/app/modules/product/product-detail/product-detail-version-action/product-detail-version-action.component.html index c12554e9..4fb9bca6 100644 --- a/marketplace-ui/src/app/modules/product/product-detail/product-detail-version-action/product-detail-version-action.component.html +++ b/marketplace-ui/src/app/modules/product/product-detail/product-detail-version-action/product-detail-version-action.component.html @@ -5,6 +5,9 @@ id="install-button" name="Install button" #installButton + [matomoClickCategory]="MatomoCategory.BUTTON" + [matomoClickAction]="MatomoAction.CLICK" + [matomoClickName]="installButton.name + ' - ' + getTrackingEnvironmentBasedOnActionType()" [lang]="languageService.selectedLanguage()" class="btn btn__install flex-grow-1 me-lg-2" data-bs-toggle="tooltip" @@ -30,6 +33,9 @@ id="download-button" name="Download button" #artifactDownloadButton + [matomoClickCategory]="MatomoCategory.BUTTON" + [matomoClickAction]="MatomoAction.CLICK" + [matomoClickName]="artifactDownloadButton.name + ' - ' + getTrackingEnvironmentBasedOnActionType()" [lang]="languageService.selectedLanguage()" class="btn btn__download btn-secondary primary-bg flex-grow-1" type="button" @@ -116,6 +122,9 @@