Support for multiple write keys.
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, typescript
- Lĩnh vực
- analytics
Hướng nghiên cứu
Start with the linked reproduction, using public/index.html and src/index.tsx to load both analytics-next instances with separate write keys. Reload the application and inspect requests to the p endpoint while only the window.analytics instance sends a page event. Done means concurrent loading no longer produces a request from the other instance.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hello,
We were led to believe that it is possible to run two instances of analytics-next with different write keys side by side. One via segment source snippet (exposed on window.analytics) and the other one as an npm module.
When we try to do this, it mostly works with one quirk/bug. If the two instances are loading concurrently (which is the common scenario), it can happen that events fired via window.analytics (segment source snippet) cause two network requests - one using the segment source snippet write key and the other one using npm module's source key. Once both instances are finished loading they behave as expected with each only firing network requests for its own events.
We were speculating that this is due to the fact that window.analytics as provided by snippet creates a queueing implementation of methods (to be used before the analytics-next is fully loaded) and then somehow snippet and npm module versions both read and fire events on that queue. Not sure if this is actually the case - it's just a guess.
I assembled a small sample application that demonstrates the issue. It loads analytics-next from both snippet and npm module, but only fires a page event on the snippet version. If you reload the page several times, you should see examples of that single page event causing two requests to be sent to a p endpoint. See:

You will of course need to provide your own write keys here and here.
Using multiple instances of analytics with different write keys seems to have been something that was "advertised" as a feature, and when talking to our Segment representative they said that this should be possible with analytics-next as well.
Thanks for any help or further info.
- Ngôn ngữ chính
- TypeScript
- Star
- 480
- Fork
- 163
- Merge trung bình
- 6 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của segmentio/analytics-next
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
segmentio/analytics-next#1324 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
segmentio/analytics-next#1366 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
segmentio/analytics-next#1338 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
segmentio/analytics-next#1337 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
segmentio/analytics-next#1332 ·
Tất cả issue của segmentio/analytics-next
Issue tương tự
-
Phone app shows Unknown for a remote machine whose key changedCó thể đã có người làm @janicduplessis đã nhận hôm nay. Đang mởarea: mobile priority: P3 type: bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
appandflow/stim#5006 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Area - Local to Cloud Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
microsoft/vscode-mssql#23209 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
code-yeongyu/senpi#5713 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
A-linter
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
oxc-project/oxc#28783 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
lingdojo/kana-dojo#33553 · 1 bình luận · 5 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày