angular / angular/angularfire

screen_view is not triggered if multiple router-outlets

未关闭
#3,168 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
7.8k
派生
2.2k
平均合并
22 小时 28 分钟
30 天内合并 PR
6

描述

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

贡献指南

打开贡献指南

调研方向

首先,使用 app.module 中提供的 ScreenTrackingService 以及 app.component.html 中的两个 outlet,在链接的 StackBlitz 中复现主从导航。比较主导航和详情导航,并确定为什么只发出 page-view;当 detail-outlet 导航以正确的 URL 发出 screen_view 时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, firebase, typescript
领域
analytics, frontend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。