Cannot set user id and user property at the same time
- Lingua principale
- TypeScript
- Stelle
- 7.8k
- Fork
- 2.2k
- Merge medio
- 22h 28m
- PR unite (30g)
- 6
Descrizione
### 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.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia riproducendo il problema con Angular 12.2.0, Firebase 9.6.6 e AngularFire 7.2.1 usando setUserId e setUserProperties con la proprietà product_amount. Esamina gli entry point di analytics di AngularFire e il comportamento di Firebase Analytics per determinare perché l'impostazione dell'ID reimposta la proprietà; il lavoro è completato quando entrambi i valori rimangono corretti e l'assegnazione all'audience è accurata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- firebase, typescript
- Ambito
- analytics
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 30/100