From 6d023828ec01b9ad762da693bca78322060a8700 Mon Sep 17 00:00:00 2001 From: piotrpekala7 <31202938+piotrpekala7@users.noreply.github.com> Date: Mon, 20 Jul 2020 16:27:23 +0200 Subject: [PATCH] Update google-analytics.service.ts --- src/app/services/google-analytics.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/services/google-analytics.service.ts b/src/app/services/google-analytics.service.ts index 536c6ba1..0a963ac7 100644 --- a/src/app/services/google-analytics.service.ts +++ b/src/app/services/google-analytics.service.ts @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'; import {Router, NavigationEnd} from '@angular/router'; import { environment } from '../../environments/environment'; -declare var ga:Function; +declare var gtag:Function; @Injectable() export class GoogleAnalyticsService { @@ -11,8 +11,8 @@ export class GoogleAnalyticsService { if (!environment.production) return; router.events.subscribe(event => { if (event instanceof NavigationEnd) { - ga('set', 'page', event.url); - ga('send', 'pageview'); + gtag('set', 'page', event.url); + gtag('send', 'pageview'); } }) }