: this gate runs inline in , where document.body does not exist yet, so a body attribute would read null here and the rule would silently never fire — the same shape of defect it is meant to fix. (cmo's spec allowed either; their parenthetical names this option.) App-only by nature: the static twin has no sessions, so base.j2 has no equivalent. */ var INTERIOR = false; function hasChoice() { try { var m = document.cookie.match(/(?:^|;\s*)klaro=([^;]*)/); if (!m) return false; var v = JSON.parse(decodeURIComponent(m[1])); return !!v && ("otgs-analytics" in v); } catch (e) { return false; } } function setup(show) { if (!window.klaro) { return void setTimeout(function () { setup(show); }, 60); } window.klaro.setup(window.otgsConsentConfig); /* show(cfg, TRUE) — the second arg is the modal flag. A bare show(cfg) from the never-inited (geo-exempt) state renders the NOTICE instead of the settings manager, so the footer button would open the wrong surface. Found by static while verifying the same snippet (MSG-static-0052 defect 1); we mirror their call shape. */ if (show) window.klaro.show(window.otgsConsentConfig, true); } /* Footer "Cookie settings" — always available, geo-gate or not: lazy-inits on demand so it works from the never-inited exempt state too. */ document.addEventListener("click", function (e) { var b = e.target && e.target.closest ? e.target.closest("[data-cookie-settings]") : null; if (!b) return; e.preventDefault(); setup(true); }); if (hasChoice()) return setup(false); /* decision exists — manager ready, nothing shows */ /* Interior + no stored choice → do nothing at all: no banner, and no /consent-policy fetch either (the answer could only be used to pop a banner we are forbidden to pop). The footer control still lazy-inits via setup(true) above, so the manager stays reachable. */ if (INTERIOR) return; var cached = null; try { cached = sessionStorage.getItem("otgs_cp"); } catch (e) {} if (cached === "0") return; /* consent not required here — no banner */ if (cached === "1") return setup(false); /* required — Klaro shows its notice */ try { fetch("/consent-policy", { credentials: "same-origin" }) .then(function (r) { return r && r.ok ? r.json() : null; }) .then(function (p) { var req = !p || p.required !== false; /* fail-safe: unknown → show */ try { sessionStorage.setItem("otgs_cp", req ? "1" : "0"); } catch (e) {} if (req) setup(false); }) .catch(function () { setup(false); }); } catch (e) { setup(false); } })();

Get help with WPML

Maiya · AI assistant
Welcome to WPML support 👋 This is where you ask our team anything. Maiya (that's me) answers right away, and a human supporter joins whenever it helps.

Please sign in to see your support questions and ask a new one.
🔐 Sign in to see your support questions and ask a new one. Sign in

Not a client yet? Ask a presales question