angular / angularfire

Angular + Firebase = ❤️
https://firebaseopensource.com/projects/angular/angularfire2
MIT License
7.69k stars 2.19k forks source link

screen_view is not triggered if multiple router-outlets #3168

Open elinake opened 2 years ago

elinake commented 2 years ago

I'm using ion-split-pane in my project to follow master-detail pattern, in which you place two router-outlets on your app.component.html and then you can navigate separately on each side of the view. An example of this pattern is here: https://ionic-angular-v5-cduaar.stackblitz.io

I have ScreenTrackingService in providers of the app.module. When I navigate in the main router-outlet, "screen-view" and "page-view" events are fired.

Processing data layer push: {event: "gtm.historyChange-v2", gtm.oldUrl: "http://localhost:4200/master-1", gtm.newUrl: 
"http://localhost:4200/master-2", gtm.triggers: "1_30"}

Processing GTAG command: ["event", "screen_view", { page_path: "/master-2", outlet: "primary" ...etc }]

When I navigate in the detail router-outlet, only "page-view" event is fired. There I can see that it has the correct url, but screen-view event is not fired.

Processing data layer push: {event: "gtm.historyChange-v2", gtm.oldUrl: "http://localhost:4200/detail-1", gtm.newUrl: 
"http://localhost:4200/detail-2", gtm.triggers: "1_30"}

Versions: Angular: 12.2.0 Ionic/angular: 5.7.0 firebase: 9.6.6 angular/fire: 7.2.1

google-oss-bot commented 2 years ago

This issue does not seem to follow the issue template. Make sure you provide all the required information.