Send gameplay analytics to the StoneSiege service - #166
Merged
Conversation
Signed-off-by: Achilleas Tsoumitas <knorcedger@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
What changed?
Replaced the gameplay GA4 transport with the first-party StoneSiege event service. The production client now batches up to 50 allowlisted events, posts credential-free
text/plainenvelopes withkeepalive, retries network/429/5xx failures once, and flushes on page hide without ever blocking play.Match start/resume/end events now share a random per-match join id, including across saved-match restores. Session grouping remains session-scoped only. The live opt-out is checked when events are queued and again before transmission, so Settings → Share anonymous gameplay stats stops requests immediately.
Updated the mobile, project, roadmap, changelog, and store disclosure sources to describe the first-party Railway/MongoDB Atlas service, two-year raw-event retention, no stored IP address, and no persistent person/device identifier. No gameplay event is sent to Google Analytics.
Paired backend: Knorcedger/stonesiege-be#2 (merged before this client ships).
Related issue
Closes #165
Why this approach?
The existing event builders and analytics sink stay provider-free; only the web/platform transport changes. Random ids use platform crypto when available and never enter deterministic simulation state. A match id is saved only with its active snapshot so aggregate reporting can join a resumed match to its outcome without creating a player identity.
The server ships first because it owns the event-name and property allowlist. The website privacy/consent update ships before this client reaches production.
Verification
npm run typechecknpm test— 1,457 passed, 11 skippednpm run buildnpm run check— typecheck, full tests, production build, bundle budget, bundle self-testhttps://api.stonesiegegame.com/api/eventsand no Google tag URL or measurement idProvenance and AI assistance
OpenAI Codex materially assisted with repository auditing, implementation, tests, documentation, and verification. I reviewed the resulting changes. No generated or third-party assets are included.
Contributor checklist
CONTRIBUTING.mdand followed the deterministic simulation rulesgit commit -s)