Cannot set user id and user property at the same time
- 主要言語
- TypeScript
- スター
- 7.8k
- フォーク
- 2.2k
- 平均マージ
- 22時間 28分
- マージ済み PR(30日)
- 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 で、product_amount プロパティを指定して setUserId と setUserProperties を使用し、問題を再現します。AngularFire の analytics エントリポイントと Firebase Analytics の動作を調査し、ID を設定するとプロパティがリセットされる理由を特定します。両方の値が正しいままになり、オーディエンスの割り当ても正確になれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- firebase, typescript
- 領域
- analytics
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 30/100