Skip to content

Commit

Permalink
Bring back Matomo tracking code (#245)
Browse files Browse the repository at this point in the history
Co-authored-by: Hoang Vu Huy <[email protected]>
  • Loading branch information
vhhoang-axonivy and Hoang Vu Huy authored Nov 29, 2024
1 parent 9013065 commit 73ffe60
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 18 deletions.
15 changes: 8 additions & 7 deletions marketplace-ui/src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -116,6 +122,9 @@
<button 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 install-designer-button m-0 col-4" id="install-button"
(click)="onUpdateInstallationCountForDesigner()" onClick="function installInDesigner() {
Expand All @@ -135,6 +144,9 @@
id="contact-us-button"
name="Contact us button"
#contactUsButton
[matomoClickCategory]="MatomoCategory.BUTTON"
[matomoClickAction]="MatomoAction.CLICK"
[matomoClickName]="contactUsButton.name + ' - ' + getTrackingEnvironmentBasedOnActionType()"
[lang]="languageService.selectedLanguage()"
class="btn row btn_contact-us"
(click)="onNavigateToContactPage()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { ActivatedRoute, Router } from '@angular/router';
import { ROUTER } from '../../../../shared/constants/router.constant';
import { MatomoCategory, MatomoAction } from '../../../../shared/enums/matomo-tracking.enum';
import { MATOMO_TRACKING_ENVIRONMENT } from '../../../../shared/constants/matomo.constant';
import { MATOMO_DIRECTIVES } from 'ngx-matomo-client';

const showDevVersionCookieName = 'showDevVersions';

Expand All @@ -46,6 +47,7 @@ const showDevVersionCookieName = 'showDevVersions';
FormsModule,
CommonDropdownComponent,
LoadingSpinnerComponent,
MATOMO_DIRECTIVES
],
templateUrl: './product-detail-version-action.component.html',
styleUrl: './product-detail-version-action.component.scss'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ <h4 [lang]="languageService.selectedLanguage()" class="sort-container__label tex
<input #productFilter autocomplete="on" [(ngModel)]="searchText" (ngModelChange)="onSearchChanged($event)" type="text"
[lang]="languageService.selectedLanguage()" class="form-control input__search bg-secondary border-0 rounded-start-0 ps-0 search-input"
[placeholder]="translateService.get('common.search.placeholder') | async"
[ariaLabel]="translateService.get('common.search.placeholder') | async" aria-describedby="search"
[ariaLabel]="translateService.get('common.search.placeholder') | async" aria-describedby="search"
[matomoTracker]="MatomoTracker.CHANGE"
[matomoCategory]="MatomoCategory.INPUT"
[matomoAction]="MatomoAction.PRODUCT_SEARCH"
[matomoName]="productFilter.value"
/>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ import { CommonDropdownComponent } from '../../../shared/components/common-dropd
import { CommonUtils } from '../../../shared/utils/common.utils';
import { ItemDropdown } from '../../../shared/models/item-dropdown.model';
import { MatomoAction, MatomoCategory, MatomoTracker } from '../../../shared/enums/matomo-tracking.enum';
import { MATOMO_DIRECTIVES } from 'ngx-matomo-client';

@Component({
selector: 'app-product-filter',
standalone: true,
imports: [CommonModule, FormsModule, TranslateModule, CommonDropdownComponent],
imports: [CommonModule, FormsModule, TranslateModule, CommonDropdownComponent, MATOMO_DIRECTIVES],
templateUrl: './product-filter.component.html',
styleUrl: './product-filter.component.scss'
})
Expand Down
5 changes: 2 additions & 3 deletions marketplace-ui/src/environments/environment.development.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export const environment = {
githubClientId: 'Iv23livu9HbsC4Q24eSC',
githubAuthCallbackPath: '/auth/github/callback',
dayInMiliseconds: 86400000,
// Disabled for later HTTPS implementation
// matomoSiteId: 1,
// matomoTrackerUrl: '//marketplace.server.ivy-cloud.com:8085'
matomoSiteId: 3,
matomoTrackerUrl: '//market.axonivy.com/matomo-web'
};
5 changes: 2 additions & 3 deletions marketplace-ui/src/environments/environment.staging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export const environment = {
githubClientId: 'Iv23livu9HbsC4Q24eSC',
githubAuthCallbackPath: '/auth/github/callback',
dayInMiliseconds: 86400000,
// Disabled for later HTTPS implementation
// matomoSiteId: 1,
// matomoTrackerUrl: '//marketplace.server.ivy-cloud.com:8085'
matomoSiteId: 2,
matomoTrackerUrl: '//market.axonivy.com/matomo-web'
};
5 changes: 2 additions & 3 deletions marketplace-ui/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export const environment = {
githubClientId: 'Ov23liK1GCV3aAmN8kby',
githubAuthCallbackPath: '/auth/github/callback',
dayInMiliseconds: 86400000,
// Disabled for later HTTPS implementation
// matomoSiteId: 1,
// matomoTrackerUrl: '//marketplace.server.ivy-cloud.com:8085'
matomoSiteId: 1,
matomoTrackerUrl: '//market.axonivy.com/matomo-web'
};

0 comments on commit 73ffe60

Please sign in to comment.