Cannot set user id and user property at the same time
- 主要語言
- TypeScript
- 星號
- 7.8k
- 分支
- 2.2k
- 平均合併
- 22 小時 28 分鐘
- 30 天內合併 PR
- 6
描述
### Version info
**Angular:** 12.2.0
**Firebase:** 9.6.6
**AngularFire:** 7.2.1
### Expected behavior
I need to set user id and a user property after a user has logged in. User property is product_amount, and the user belongs to different audiences based on the product_amount.
### Actual behavior
Every user is counted to belong to two audiences. After user has logged in, I set `this.analytics.setUserId(id);`, which causes product_amount to be zero. After user id is set, I set user properties with
```
this.analytics.setUserProperties(
{ product_amount: this.product_amount },
{ global: true }
);
```
which logs the real product amount.
It is not possible to set user id and user properties at the same time. That means initial user property is always the wrong one.
貢獻指南
研究方向
首先,使用 Angular 12.2.0、Firebase 9.6.6 和 AngularFire 7.2.1,透過 setUserId 和 setUserProperties 設定 product_amount 屬性來重現問題。檢查 AngularFire 的 analytics 進入點和 Firebase Analytics 的行為,以判斷為什麼設定 ID 會重設該屬性;當兩個值都維持正確且受眾指派準確時,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- firebase, typescript
- 領域
- analytics
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 30/100