Hi there, thank you guys for a great universal starter project that was really useful to me. I just added the `gtag` to be able to track the google analytics router change event in my application that based on the universal starter. Then when I run `npm run build:prerender` that giving me an error `ERROR ReferenceError: gtag is not defined` I modified the starter with this [code](https://github.com/kuncevic/universal-starter/commit/e82d6ea3a2a1f645d69e397ad7b4a44bf0547529) : ``` export class AppComponent implements OnInit { constructor(public router: Router) {} ngOnInit() { const navEndEvent$ = this.router.events.pipe(filter(e => e instanceof NavigationEnd)); navEndEvent$.subscribe((e: NavigationEnd) => { gtag('config', 'UA-xxxxxxxxx-x', { page_path: e.urlAfterRedirects }); }); } } ``` So you can reproduce it by cloning https://github.com/kuncevic/universal-starter
Hi there, thank you guys for a great universal starter project that was really useful to me.
I just added the
gtagto be able to track the google analytics router change event in my application that based on the universal starter.Then when I run
npm run build:prerenderthat giving me an errorERROR ReferenceError: gtag is not definedI modified the starter with this code :
So you can reproduce it by cloning https://github.com/kuncevic/universal-starter