Repository navigation
Feat/analytics consent and instrumentation - #1494
Merged
greatest0fallt1me merged 3 commits intoNov 26, 2026
Merged
greatest0fallt1me merged 3 commits into
greatest0fallt1me merged 3 commits into
Conversation
…ort, and funnel instrumentation
|
@Opulencechuks Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
pr-malware-guard: resolvedNo rules match the latest changes any more. Thank you! |
Contributor
|
Thanks @Opulencechuks! Merged. 🎉 |
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.
Closes #1376
Summary
Adds privacy-first, opt-in analytics consent UI, settings toggle, batched beacon transport, and route/deposit-funnel instrumentation.
What Changed
src/utils/userPrefs.ts,src/components/ConsentBanner.tsx)UserPrefswithanalyticsConsentDecided(defaultfalse) so declining does not re-prompt, with safe fallback for malformed stored preferences.ConsentBanner(role="region") with Accept/Decline actions.AnalyticsToggle(role="switch") in the app header that reads/writesanalyticsConsentviasetPrefand stays synced with the banner.src/services/AnalyticsService.ts)apiUrl('/api/analytics/events')vianavigator.sendBeaconwith afetch(..., { method: 'POST', keepalive: true })fallback.pagehideandvisibilitychange(hidden), caps retries at 3, never enqueues while consent isfalse, and immediately clears the queue when consent is revoked.src/App.tsx)route_viewevents on pathname change ({ path }only — no query strings or user IDs).deposit_started,deposit_signed,deposit_confirmed,deposit_failed) with only{ network }(and error codereasonon failure) — no wallet addresses, amounts, tokens, or transaction hashes.docs/Configuration.md)src/services/AnalyticsService.test.ts,src/components/ConsentBanner.test.tsx)pagehide/visibilitychangeflush,sendBeaconabsent fallback, retry cap, revoke-clears-queue, secret redaction, consent banner persistence, toggle sync, and malformed stored prefs.Testing
npx vitest run src/services/AnalyticsService.test.ts src/utils/userPrefs.test.ts src/components/ConsentBanner.test.tsx src/App.deposit.test.tsxnpm run typecheck(0 errors in touched files)