Commit c99683a3 authored by Dimitri DI GUSTO's avatar Dimitri DI GUSTO
Browse files

Merge branch 'DOS99492_TAC' into 'master'

Replace old matomo implementation (angulartics2)

See merge request !151
parents 5a3e37f3 ed657342
Pipeline #19920 passed with stage
in 9 minutes and 15 seconds
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()
......
......@@ -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
......
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() {
......
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;
......
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]);
}
}
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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment