Repository navigation
fix(consent): Cookie settings reopen + immediate GA4 withdrawal - #894
Merged
Merged
Conversation
…isable, consent denied, clear _ga)
1 task done
… page_title after route title update
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.
Base branch:
fix/ga-spa-page-view(stacked on #893 because both touchGoogleAnalytics.tsx; GitHub retargets todeveloponce #893 merges).Summary
P0 from the Phase 1 analytics audit: after Accept there was no way to withdraw consent (banner gone,
/cookieshad no control) and_gacookies stayed; even a reject would only unmount the component while gtag.js kept running.cookie-settings-button.tsx) in the footer (Company column) and in/cookies→ "Your choices". It dispatchestt-cookie-settings-open;CookieConsentreopens the existing banner (also when the choice isaccepted; Cancel keeps the current choice).lib/google-analytics-consent.ts, called fromGoogleAnalytics.tsx):window['ga-disable-G-VL5GTNNCHH'] = true,gtag('consent','update',{analytics_storage:'denied'}), delete_ga/_ga_*on host + parent domains. No reload.ga-disableand grants storage again.accepted)./cookiescopy: one added sentence: "You can change or withdraw your choice at any time. Withdrawing stops Google Analytics immediately and deletes its cookies."How to test
pnpm lint✅; dashboardvitest✅ 75 files / 452 tests (new:google-analytics-consent.test.ts,cookie-consent.test.tsx, footer + GoogleAnalytics withdrawal cases);next build✅.next start, GA/collectintercepted locally): Accept → Cookie settings → Reject:_gacookies [], 0 hits on the next navigation. Reject → Accept without reload still sends 1page_view.page_view+scroll) can still be flushed at the moment of withdrawal; they were collected while consent was granted. Nothing is collected after.Checklist
[Unreleased]· [x] No breaking changesSecurity / privacy
Strengthens GDPR consent withdrawal. No new cookies, no new data collected.