1 · The legacy appendDocument() integration

This page runs the existing GTM integration snippet, unchanged — the same poll-for-the-SDK-then-call pattern that is already deployed on customer sites. The point of this page is to prove that no existing implementation has to change: the snippet below was not modified for multi-language, yet the document it renders is now resolved by scenario.

Switch the page language: English (default) Čeština (?lang=cs)   The scenario reads the page URL — nothing in the snippet changes.

The snippet, verbatim

<div id="waulterCookies"></div>

<script>
(function () {
  var check = function () {
    return window.WaulterSDK && window.WaulterSDK.appendDocument instanceof Function;
  };
  var run = function () {
    if (check()) {
      console.log("[GTM][Waulter]", "SDK ready");
      window.WaulterSDK.appendDocument("waulterCookies", "AG0998");
      return;
    }
    new Promise(function (resolve, reject) {
      var start = Date.now();
      var timer = setInterval(function () {
        var elapsed = Date.now() - start;
        if (elapsed >= 8e3) {
          clearInterval(timer);
          console.warn("[GTM][Waulter]", "Timeout after " + elapsed + "ms");
          reject();
          return;
        }
        if (check()) {
          clearInterval(timer);
          console.log("[GTM][Waulter]", "SDK ready after " + elapsed + "ms");
          resolve();
        }
      }, 100);
    })
      .then(function () {
        window.WaulterSDK.appendDocument("waulterCookies", "AG0998");
      })
      .catch(function () {});
  };
  if (document.readyState === "loading") {
    var handler = function () {
      run();
      document.removeEventListener("DOMContentLoaded", handler);
    };
    document.addEventListener("DOMContentLoaded", handler);
  } else {
    run();
  }
})();
</script>
Only one thing was substituted: the agreement id. The original snippet used AG1034, which belongs to a different customer (zslibchavy.cz) and so is not resolvable from this domain — resolution is bound to the configuration that owns the page's host. This page declares demo-3's own cookie policy, AG0998. Everything else is byte-for-byte the snippet already in production.

Result

waiting…