Controlling Analytics with a Consent System
liwan does not include a consent manager. If your consent system disables analytics, set this local storage item before the tracker loads:
localStorage.setItem("disable-liwan", "true");When this item is set before the tracker loads, the tracker ignores pageviews and does not schedule a page-exit request. Remove it when analytics is enabled:
localStorage.removeItem("disable-liwan");Integrate this flag with your consent system so the system’s stored choice and the tracker state remain consistent. Reload the current page after disabling analytics to clear a page-exit request that was already scheduled.
By default, pageview tracking sends a best-effort follow-up request when the page becomes hidden. To disable only this duration signal, add data-exit="false" to the script element or pass exit: false to the npm tracker’s trackPageviews function.
For server-side collection controls, see Data Collection.