2 · The declarative data attribute

No script, no function call, no ordering concern. The page author writes one attribute and the SDK finds it — at start-up, and again for any element added to the DOM later. This is the preferred integration for new work; page 1 exists to show the old one still works.

Switch the page language: English (default) Čeština (?lang=cs)

The whole integration

<div data-waulter-document="AG0998"></div>

Result — written at page load

waiting…

Result — element injected after load

Click the button. It appends a brand-new element carrying the same attribute, well after the SDK has finished its initial scan. A MutationObserver inside the SDK picks it up, which is what makes this safe with client-side routing and late-rendered content.

var el = document.createElement("div");
el.id = "lateDoc";
el.setAttribute("data-waulter-document", "AG0998");
container.appendChild(el);   // the SDK notices it — nothing else to call

Why the attribute is preferred. The legacy snippet on page 1 has to poll for the SDK because a script can run before the SDK is loaded. The attribute has no such race — it is inert markup until the SDK arrives, whenever that is.