diff --git a/package.json b/package.json index 5e761b9259433f52803f9bc8283e65bef80a1acf..0c809a322029c26c8907f29ec91667c049fc50af 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,6 @@ "@turf/helpers": "^6.1.4", "@turf/projection": "^6.0.1", "@turf/turf": "^5.1.6", - "angulartics2": "^9.1.0", "bulma": "^0.7.5", "bulma-checkradio": "^2.1.0", "bulma-slider": "^2.0.4", diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 0eb2bccedb9f920c46ee3c7317640256c74b4b37..1f1ad4740972b022c7369b26a49a4e357b8511db 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,6 +1,5 @@ import { Component, OnInit } from '@angular/core'; import { Title } from '@angular/platform-browser'; -import { Angulartics2Piwik } from 'angulartics2/piwik'; import { filter, map } from 'rxjs/operators'; import { ActivatedRoute, NavigationEnd, Router } from '@angular/router'; import { environment } from '../environments/environment'; @@ -22,10 +21,8 @@ export class AppComponent implements OnInit { private _navigationHistoryService: NavigationHistoryService, private _activatedRoute: ActivatedRoute, private _titleService: Title, - private _angulartics2Piwik: Angulartics2Piwik, private _seoSErvice: SeoSErvice, ) { - this._angulartics2Piwik.startTracking(); } ngOnInit() diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 18182107a0f27ac0c204309fdfd86709e2854ff0..6cc9da4bc075e8cf03ad0014e17f718038839178 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -7,7 +7,6 @@ import { AppComponent } from './app.component'; import { AppRoutingModule } from './app-routing.module'; import { CoreModule } from './core/core.module'; import { EditorialisationModule } from './editorialisation/editorialisation.module'; -import { Angulartics2Module } from 'angulartics2'; import { UserModule } from './user/user.module'; import { UserService } from './user/services'; import { AppConfigService, NotificationService, TarteAuCitronService } from './core/services'; @@ -65,7 +64,6 @@ export function initAppConfig(appConfigService: AppConfigService) { EditorialisationModule, UserModule, AppRoutingModule, - Angulartics2Module.forRoot(), ], providers: [ // The order is important as the InitUserService require the configuration of the app diff --git a/src/app/core/components/main/header/header.component.ts b/src/app/core/components/main/header/header.component.ts index aa737100293fdce377bc166c132082c1c54ba859..83cefeeaf5d692502bcc18ab97370a1a269d4105 100644 --- a/src/app/core/components/main/header/header.component.ts +++ b/src/app/core/components/main/header/header.component.ts @@ -1,10 +1,11 @@ import { Component, OnInit } from '@angular/core'; import { NavigationEnd, Router } from '@angular/router'; -import { Angulartics2Piwik } from 'angulartics2/piwik'; import { AppRoutes } from '../../../../routes'; import { UserService } from '../../../../user/services'; import { AppStateService } from '../../../services'; +declare var _paq: any; + @Component({ selector: 'app-header', templateUrl: './header.component.html', @@ -22,7 +23,6 @@ export class HeaderComponent implements OnInit { private _router: Router, private _userService: UserService, private _appStateService: AppStateService, - private _angulartics2Piwik: Angulartics2Piwik, ) { } ngOnInit() { @@ -41,7 +41,7 @@ export class HeaderComponent implements OnInit { toggleBurger() { this.isBurgerActive = !this.isBurgerActive; this._appStateService.changeMenuState(this.isBurgerActive); - this._angulartics2Piwik.eventTrack('BurgerMenu', { category: 'Navigation', label: 'BurgerManu', value: 1 }); + _paq.push(['trackEvent', 'Navigation', 'BurgerMenu', 'BurgerManu', 1]); } toggleUserDropdown() { diff --git a/src/app/datasets/services/dataset-research.service.ts b/src/app/datasets/services/dataset-research.service.ts index 768542bebc747aab9624290c2e58339feb7e669c..be64dc122425c0eb13a10562767b8e3df4e89a5e 100644 --- a/src/app/datasets/services/dataset-research.service.ts +++ b/src/app/datasets/services/dataset-research.service.ts @@ -1,6 +1,5 @@ import { Injectable } from '@angular/core'; import { Router } from '@angular/router'; -import { Angulartics2Piwik } from 'angulartics2/piwik'; import { Observable, Subject } from 'rxjs'; import { catchError, map, tap } from 'rxjs/operators'; import { geosource, notificationMessages } from '../../../i18n/traductions'; @@ -16,6 +15,8 @@ import { scopesResearch } from '../../shared/variables'; import { SearchCompletion, SearchSuggestion } from '../models'; import { ResearchUrlService } from './research-url.service'; +declare var _paq: any; + @Injectable() export class DatasetResearchService { @@ -30,7 +31,6 @@ export class DatasetResearchService { constructor( private _errorService: ErrorService, private _elasticsearchService: ElasticsearchService, - private angulartics2Piwik: Angulartics2Piwik, private _router: Router, private _researchUrlService: ResearchUrlService, ) { @@ -208,7 +208,7 @@ export class DatasetResearchService { }); // Matomo tracking - this.angulartics2Piwik.eventTrack('trackSiteSearch', { keyword: this.searchString }); + _paq.push(['trackSiteSearch', this.searchString]); this._elasticsearchOptions.shouldAggregateFilters = true; this._elasticsearchOptions.shouldAggregateResultCount = false; diff --git a/src/app/editorialisation/components/home/home.component.ts b/src/app/editorialisation/components/home/home.component.ts index 49baebf709786c1c7d191003b77be3fb65f17327..9a2941e5189021747e2548d9f8b5da38180144f4 100644 --- a/src/app/editorialisation/components/home/home.component.ts +++ b/src/app/editorialisation/components/home/home.component.ts @@ -1,7 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { Meta } from '@angular/platform-browser'; import { Router } from '@angular/router'; -import { Angulartics2Piwik } from 'angulartics2/piwik'; import { forkJoin } from 'rxjs/internal/observable/forkJoin'; import { environment } from '../../../../environments/environment'; import { metaDescription, notificationMessages } from '../../../../i18n/traductions'; @@ -13,6 +12,8 @@ import { AppRoutes } from '../../../routes'; import { scopesResearch } from '../../../shared/variables'; import { CMSContent, IESCMSResponse } from '../../models/cms-content.model'; +declare var _paq: any; + @Component({ selector: 'app-home', templateUrl: './home.component.html', @@ -37,7 +38,6 @@ export class HomeComponent implements OnInit { private _datasetResearchService: DatasetResearchService, private _notificationService: NotificationService, private _router: Router, - private _angulartics2Piwik: Angulartics2Piwik, private _meta: Meta, ) { } @@ -106,6 +106,6 @@ export class HomeComponent implements OnInit { } trackExploreButtonEvent() { - this._angulartics2Piwik.eventTrack('ExploreButton', { category: 'HomePage', label: 'Explore', value: 1 }); + _paq.push(['trackEvent', 'HomePage', 'ExploreButton', 'Explore', 1]); } } diff --git a/src/app/shared/components/page-header/page-header.component.ts b/src/app/shared/components/page-header/page-header.component.ts index 994599fd5fee2277fd1f1361b89ef3042f5c43ec..591bc54dac6e1640571a08ac53a0e3700172c27f 100644 --- a/src/app/shared/components/page-header/page-header.component.ts +++ b/src/app/shared/components/page-header/page-header.component.ts @@ -1,12 +1,12 @@ import { Component, Input, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; -import { Angulartics2Piwik } from 'angulartics2/piwik'; import { buttonCopyLinkToCliboardMessages } from '../../../../i18n/traductions'; import { NavigationHistoryService } from '../../../core/services'; import { APP_CONFIG } from '../../../core/services/app-config.service'; import { AppRoutes } from '../../../routes'; import { IPageHeaderInfo } from '../../models'; +declare var _paq: any; @Component({ selector: 'app-page-header', templateUrl: './page-header.component.html', @@ -17,7 +17,6 @@ export class PageHeaderComponent implements OnInit { constructor( private _navigationHistoryService: NavigationHistoryService, private _router: Router, - private _angulartics2Piwik: Angulartics2Piwik, private _activatedRoute: ActivatedRoute, ) { } @@ -65,7 +64,7 @@ export class PageHeaderComponent implements OnInit { } this.messageClipboard = buttonCopyLinkToCliboardMessages.copied; - this._angulartics2Piwik.eventTrack('ShareArticle', { category: 'Edito', label: window.location.href, value: 1 }); + _paq.push(['trackEvent', 'Edito', 'ShareArticle', window.location.href, 1]); setTimeout(() => { this.messageClipboard = buttonCopyLinkToCliboardMessages.hover;