fix(vega): suppress generic web billing events on vega - #1097
Open
fire-at-will wants to merge 2 commits into
Open
fix(vega): suppress generic web billing events on vega#1097fire-at-will wants to merge 2 commits into
fire-at-will wants to merge 2 commits into
Conversation
tonidero
reviewed
Aug 27, 2026
tonidero
left a comment
Contributor
There was a problem hiding this comment.
I would love for the web team to take a look at this. On my side just a couple questions 🙏
| Logger.verboseLog("Skipping event tracking, the EventsTracker is silent"); | ||
| return; | ||
| } | ||
| if (this.suppressGenericEvents) { |
Contributor
There was a problem hiding this comment.
Hmm I would say the proper fix is probably to pass the store or something like that in these events instead... Do we plan to do something like that as a follow-up?
| this.eventsUrl = `${props.httpConfig?.eventsURL ?? RC_ANALYTICS_ENDPOINT}/v1/events`; | ||
| this.appUserId = props.appUserId; | ||
| this.isSilent = props.silent || false; | ||
| this.suppressGenericEvents = isAmazonApiKey(props.apiKey); |
Contributor
joshdholtz
approved these changes
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation / Description
The JS SDK emits many events that are web-billing specific, and that the backend classifies as RCBilling events. We were incorrectly emitting these events when running on Vega. This caused events to be emitted by Vega apps that got classified as web billing events by the backend.
Changes introduced
Prevents the SDK from emitting generic web billing events (including sdk_initialized) when the SDK is initialized with an Amazon API key. Paywall events are still emitted, as they aren't classified as web billing events in the backend.
Note
Low Risk
Analytics-only behavior gated on API key prefix; purchase and paywall event paths are explicitly preserved in tests.
Overview
Stops generic web billing analytics (e.g.
sdk_initialized, external/SDKweb_billingevents) whenEventsTrackeris constructed with an Amazon API key (isAmazonApiKey), so Vega apps no longer send events the backend misclassifies as RCBilling.The guard lives in private
trackEventvia a newsuppressGenericEventsflag set in the constructor. Paywall and custom paywall impression events are unchanged and still flush to/v1/events.Tests replace the old Amazon
X-Platformheader expectation with coverage that generic tracking is skipped while paywall paths still post, plus aPurchases.configurecase asserting nosdk_initializedforamzn_valid_key.Reviewed by Cursor Bugbot for commit cd13f18. Bugbot is set up for automated code reviews on this repo. Configure here.