From 37ff0b1856d475007f9e3a1072a69e07a96b1558 Mon Sep 17 00:00:00 2001 From: Dawid Zbinski Date: Mon, 1 Jun 2026 18:59:49 +0200 Subject: [PATCH] fix(web): grant all consent-mode v2 signals on accept The gtag('consent','default', ...) block in web/index.html declares four signals as denied (analytics_storage, ad_storage, ad_user_data, ad_personalization), but the accept handler's consent 'update' call only lifted analytics_storage. The three ad signals therefore stayed denied for every visitor who clicked accept, so Google's Consent Mode diagnostic reported a 0% consent rate (100% of consent signals marked as denied). The accept button ("Sure, track away") represents full consent, so the update now grants all four signals declared in the default block. Co-Authored-By: Claude Opus 4.8 (1M context) --- web/js/main.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/js/main.js b/web/js/main.js index 4fe6020..2a91121 100644 --- a/web/js/main.js +++ b/web/js/main.js @@ -130,9 +130,13 @@ document.querySelectorAll('.copy-btn').forEach(function (btn) { var rejectBtn = document.getElementById('consent-reject'); function loadGTM() { - // Update consent state + // Update consent state — grant all signals declared in the default block, + // otherwise the un-granted ad signals stay denied forever (0% consent rate). gtag('consent', 'update', { - 'analytics_storage': 'granted' + 'analytics_storage': 'granted', + 'ad_storage': 'granted', + 'ad_user_data': 'granted', + 'ad_personalization': 'granted' }); // Inject GTM script