angular / angular/angularfire

Cannot set user id and user property at the same time

Đang mở
#3,193 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
7.8k
Fork
2.2k
Merge trung bình
22 giờ 28 phút
Pull request đã merge (30 ngày)
6

Mô tả

### 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện sự cố với Angular 12.2.0, Firebase 9.6.6 và AngularFire 7.2.1 bằng cách sử dụng setUserId và setUserProperties với thuộc tính product_amount. Kiểm tra các entry point analytics của AngularFire và hành vi của Firebase Analytics để xác định tại sao việc đặt ID lại đặt lại thuộc tính; hoàn tất khi cả hai giá trị vẫn chính xác và việc gán audience là chính xác.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
firebase, typescript
Lĩnh vực
analytics
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
30/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.