Previously, I manually fired the Page View Event using JavaScript from app.component.ts
while directly accessing Google Analytics:
declare var gtag: Function;
...
constructor(private router: Router) {
const navEndEvents = this.router.events.pipe(
filter((event) => event instanceof NavigationEnd)
);
navEndEvents.subscribe((event: NavigationEnd) => {
gtag('config', 'xxx', {
page_path: event.urlAfterRedirects,
page_title: event.urlAfterRedirects
});
})
}
Now, I am looking to integrate Google Analytics with Google Tag Manager. How should I now send the Page View Event?