diff --git a/src/app/core/shared/search/search.service.spec.ts b/src/app/core/shared/search/search.service.spec.ts index 365523b9cf..d3174e10a5 100644 --- a/src/app/core/shared/search/search.service.spec.ts +++ b/src/app/core/shared/search/search.service.spec.ts @@ -36,7 +36,6 @@ import { ViewMode } from '../view-mode.model'; import { SearchService } from './search.service'; import { SearchConfigurationService } from './search-configuration.service'; import anything = jasmine.anything; -import { MatomoTestingModule } from 'ngx-matomo-client/testing'; @Component({ @@ -57,7 +56,6 @@ describe('SearchService', () => { TestBed.configureTestingModule({ imports: [ CommonModule, - MatomoTestingModule.forRoot(), RouterTestingModule.withRoutes([ { path: 'search', component: DummyComponent, pathMatch: 'full' }, ]), @@ -125,7 +123,6 @@ describe('SearchService', () => { TestBed.configureTestingModule({ imports: [ CommonModule, - MatomoTestingModule.forRoot(), RouterTestingModule.withRoutes([ { path: 'search', component: DummyComponent, pathMatch: 'full' }, ]), diff --git a/src/app/core/shared/search/search.service.ts b/src/app/core/shared/search/search.service.ts index 7afefd9659..9fa03ee5ad 100644 --- a/src/app/core/shared/search/search.service.ts +++ b/src/app/core/shared/search/search.service.ts @@ -1,7 +1,6 @@ /* eslint-disable max-classes-per-file */ import { Injectable } from '@angular/core'; import { Angulartics2 } from 'angulartics2'; -import { MatomoTracker } from 'ngx-matomo-client'; import { BehaviorSubject, combineLatest as observableCombineLatest, @@ -113,7 +112,6 @@ export class SearchService { private paginationService: PaginationService, private searchConfigurationService: SearchConfigurationService, private angulartics2: Angulartics2, - private matomoTracker: MatomoTracker, ) { this.searchDataService = new SearchDataService(); } @@ -388,7 +386,6 @@ export class SearchService { }, }; - this.matomoTracker.trackSiteSearch(config.query, config.scope, searchQueryResponse.pageInfo.totalElements, searchTrackObject); this.angulartics2.eventTrack.next(searchTrackObject); } diff --git a/src/app/statistics/matomo.service.ts b/src/app/statistics/matomo.service.ts index 553eba851f..16f413517f 100644 --- a/src/app/statistics/matomo.service.ts +++ b/src/app/statistics/matomo.service.ts @@ -46,7 +46,7 @@ export class MatomoService { const preferences$ = this.orejimeService.getSavedPreferences(); preferences$.subscribe(preferences => { - this.changeMatomoConsent(preferences.matomo); + this.changeMatomoConsent(preferences?.matomo); if (environment.matomo?.siteId && environment.matomo?.trackerUrl) { this.matomoInitializer.initializeTracker({