Fixed google analytics live tracking

This commit is contained in:
2018-07-14 12:23:00 -04:00
parent 177a671c69
commit dae9910174
2 changed files with 12 additions and 8 deletions

View File

@ -18,8 +18,11 @@ export class AppComponent implements OnInit {
ngOnInit() {
// Record routing for analytics
this.router.events.pipe(filter(event => event instanceof NavigationEnd)).subscribe((event: NavigationEnd) => {
(<any>window).ga('set', 'page', event.urlAfterRedirects);
(<any>window).ga('send', 'pageview');
let ga = (<any>window).ga;
if (ga) {
ga('set', 'page', event.urlAfterRedirects);
ga('send', 'pageview');
}
});
// Send electron users right to formula manager