mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2024-12-30 01:38:50 +00:00
Update google-analytics.service.ts
This commit is contained in:
parent
e9aeb169c5
commit
6d023828ec
@ -2,7 +2,7 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {Router, NavigationEnd} from '@angular/router';
|
import {Router, NavigationEnd} from '@angular/router';
|
||||||
import { environment } from '../../environments/environment';
|
import { environment } from '../../environments/environment';
|
||||||
declare var ga:Function;
|
declare var gtag:Function;
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class GoogleAnalyticsService {
|
export class GoogleAnalyticsService {
|
||||||
@ -11,8 +11,8 @@ export class GoogleAnalyticsService {
|
|||||||
if (!environment.production) return;
|
if (!environment.production) return;
|
||||||
router.events.subscribe(event => {
|
router.events.subscribe(event => {
|
||||||
if (event instanceof NavigationEnd) {
|
if (event instanceof NavigationEnd) {
|
||||||
ga('set', 'page', event.url);
|
gtag('set', 'page', event.url);
|
||||||
ga('send', 'pageview');
|
gtag('send', 'pageview');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user