From c0a064269b8b5e9fafb995f71281aaef8d7ae18c Mon Sep 17 00:00:00 2001 From: Franz <1286618+fjp@users.noreply.github.com> Date: Thu, 8 Oct 2026 14:09:50 +0200 Subject: [PATCH 1/2] Cookie settings: explain when the consent tool is blocked Ad blockers usually block Google's consent tool, so the Cookie settings link silently did nothing. If the tool hasn't run 2.5 s after the click, a short note says it's blocked, that Analytics doesn't load then, and that there's no consent to change. --- _includes/footer/custom.html | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/_includes/footer/custom.html b/_includes/footer/custom.html index cd07b954..bf81b12c 100644 --- a/_includes/footer/custom.html +++ b/_includes/footer/custom.html @@ -4,13 +4,26 @@
As an Amazon Associate I earn from qualifying purchases. From 670d19f77ae649d52a09ca40b8b31f28b66d78dc Mon Sep 17 00:00:00 2001 From: Franz <1286618+fjp@users.noreply.github.com> Date: Thu, 8 Oct 2026 14:20:07 +0200 Subject: [PATCH 2/2] Cookie settings note: remove it when the tool loads late; wording Codex review: - if the consent tool answered after 2.5 s, the note stayed up although the settings opened; the callback now clears the timer and removes a shown note (and a flag covers callbacks that run inside push) - 'there's no consent to change' was wrong for visitors with an earlier choice; the note now says the settings can't be opened here and that any earlier choice stays as it was - the note uses calc(100vw - 2rem) up to 32rem, instead of half the screen width on phones --- _includes/footer/custom.html | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/_includes/footer/custom.html b/_includes/footer/custom.html index bf81b12c..89bbf7fa 100644 --- a/_includes/footer/custom.html +++ b/_includes/footer/custom.html @@ -10,17 +10,25 @@ event.preventDefault(); window.googlefc = window.googlefc || {}; window.googlefc.callbackQueue = window.googlefc.callbackQueue || []; - var opened = false; - window.googlefc.callbackQueue.push(function () { opened = true; window.googlefc.showRevocationMessage(); }); + var timer = null, opened = false; + window.googlefc.callbackQueue.push(function () { + // the tool is there (possibly late): drop the pending or shown note, then open the settings + opened = true; + clearTimeout(timer); + var shown = document.getElementById("cookie-settings-note"); + if (shown) shown.remove(); + window.googlefc.showRevocationMessage(); + }); // If Google's consent tool is blocked (ad blockers usually block it), the queue never runs: say so - setTimeout(function () { + timer = setTimeout(function () { if (opened || document.getElementById("cookie-settings-note")) return; var note = document.createElement("div"); note.id = "cookie-settings-note"; note.setAttribute("role", "status"); - note.textContent = "Google's consent tool didn't load in this browser, probably because of an ad blocker or privacy extension. While it's blocked, Google Analytics doesn't load here and there's no consent to change."; - note.style.cssText = "position:fixed;left:50%;bottom:1rem;transform:translateX(-50%);z-index:1000;max-width:32rem;" + - "padding:.8em 1em;background:#333;color:#fff;border-radius:4px;font-size:.8rem;line-height:1.4;box-shadow:0 2px 8px rgba(0,0,0,.3)"; + note.textContent = "Google's consent tool isn't available in this browser right now, probably because of an ad blocker or privacy extension, so the cookie settings can't be opened here. Any earlier choice stays as it was, and Google Analytics doesn't start on this page while the tool is blocked."; + note.style.cssText = "position:fixed;left:50%;bottom:1rem;transform:translateX(-50%);z-index:1000;box-sizing:border-box;" + + "width:calc(100vw - 2rem);max-width:32rem;padding:.8em 1em;background:#333;color:#fff;border-radius:4px;" + + "font-size:.8rem;line-height:1.4;box-shadow:0 2px 8px rgba(0,0,0,.3)"; document.body.appendChild(note); setTimeout(function () { note.remove(); }, 12000); }, 2500);