amplitude / amplitude/Amplitude-TypeScript

Delay events until `BrowserClient` is initialised

Đang mở
#1,043 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
TypeScript
Star
180
Fork
68
Merge trung bình
3 ngày 1 giờ
Pull request đã merge (30 ngày)
29

Mô tả

## Summary

The `init` method of `BrowserClient` is async. While the initialisation is ongoing, the application can already track events. These events will then not be processed by plugins.

With the `dispatchQ` in the `CoreClient` there is already a mechanism to buffer events. However tracked events are only put on the queue while `CoreClient` is initialising (`isReady === false`). The queue however is [processed](https://github.com/amplitude/Amplitude-TypeScript/blob/f0e35ac0700f90c38672c2bfa1c239d50c7181e2/packages/analytics-browser/src/browser-client.ts#L160) when the `BrowserClient` is done initialising.

## Motivations
In our tracking setup we have the issue that events are tracked before the `BrowserClient` is fully initialised. We rely on a custom plugin to run first to ensure user properties are populated.

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

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

Đánh giá

Issue này chưa được đánh giá.

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.