Skip to content

Implement Google Consent Mode V2#1167

Merged
evulins merged 9 commits intomasterfrom
feature/consent-mode-v2
Mar 30, 2026
Merged

Implement Google Consent Mode V2#1167
evulins merged 9 commits intomasterfrom
feature/consent-mode-v2

Conversation

@evulins
Copy link
Copy Markdown
Collaborator

@evulins evulins commented Mar 25, 2026

Summary

  • Upgrade cookie consent to Google Consent Mode V2, sending all 4 required params (analytics_storage, ad_storage, ad_user_data, ad_personalization) in a single gtag('consent', 'update', ...) call
  • Load GTM unconditionally with all consent signals defaulted to denied, then restore saved preferences from localStorage before GTM fires
  • Guard against undefined sessions in fixedSessionsSelectors to prevent runtime crash
  • Update cookieManager tests to cover all V2 consent parameter combinations

Trello task

Test plan

  • Verify GTM loads on page load with consent defaults set to denied
  • Accept analytics only - confirm analytics_storage granted, ad params denied
  • Accept marketing only - confirm ad params granted, analytics_storage denied
  • Accept all - confirm all 4 params granted
  • Deny all - confirm all 4 params denied and cookies are cleared
  • Verify consent state persists across page reloads via localStorage

Copy link
Copy Markdown
Collaborator

@hanka hanka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@evulins evulins merged commit 42a19fb into master Mar 30, 2026
@evulins evulins deleted the feature/consent-mode-v2 branch March 30, 2026 09:58
hanka added a commit that referenced this pull request Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants