Single-page apps (React, Vue, Svelte)
Page changes are tracked automatically; nothing extra to wire up.
Load the tag once in your HTML shell. It watches pushState, replaceState, and the back button, and records a page view whenever the URL changes.
<script async src="https://cdn.wholayer.com/t.js" data-site="YOUR_SITE_KEY"></script>The command queue
If you need to call the tag before it has loaded (for example, from a consent banner that renders first), queue the call:
window.wholayer = window.wholayer || function () { (window.wholayer.q = window.wholayer.q || []).push(arguments); };
window.wholayer("consent", true);Queued calls run as soon as the tag loads.
Was this helpful?