Add GDPR cookie-consent banner (Consent Mode v2)
- consent.js: self-contained, non-blocking bottom banner in EN/MK/SI, remembers the choice in localStorage, links to the per-language cookie policy. Accept -> gtag consent 'update' granted; Decline stays denied. - Head GA snippet restores a returning visitor's prior "granted" choice before the first hit; loads /consent.js on every page. - Re-openable via window.msosOpenConsent() for a "manage cookies" link. Verified in-browser: shows for new visitors, Accept grants + remembers, reload keeps consent without re-prompting, Slovene text + /si/ policy link. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
9a6d2c335c
commit
f24fc704d6
203 files changed
+1100
No files matched your search
@@ -85,9 +85,14 @@ GA_LINES = [
|
||||
" ad_storage: 'denied', ad_user_data: 'denied', ad_personalization: 'denied',",
|
||||
" analytics_storage: 'denied', wait_for_update: 500",
|
||||
" });",
|
||||
" // Restore a returning visitor's prior choice before the first hit.",
|
||||
" try { if (localStorage.getItem('msos-consent') === 'granted') {",
|
||||
" gtag('consent', 'update', { ad_storage:'granted', ad_user_data:'granted',",
|
||||
" ad_personalization:'granted', analytics_storage:'granted' }); } } catch(e){}",
|
||||
" gtag('js', new Date());",
|
||||
f" gtag('config', '{GA_ID}');",
|
||||
' </script>',
|
||||
' <script src="/consent.js" defer></script>',
|
||||
]
|
||||
|
||||
# ---- page trees (for hreflang parity) ----
|
||||
|
||||
Reference in new issue
Block a user