Docs/Tracking

Install the snippet

Three ways to add the script: paste it, Tag Manager, or a JavaScript app.

Open Tracking, then Tracking Script. The snippet block there offers three ways to install, and the key in it is unique to your domain. Pick the one that fits your site.

Script

For any site where you can edit the page head. Paste this before the closing </head> tag on every page you want to track.

Tracking snippet
<script src="https://localwrangler.com/track.js" data-key="lw_xxxxxxxx" async></script>

Tag Manager

For sites managed through Google Tag Manager. Tag Manager injects the tag itself, so the key is set on the page instead of on the script tag. Add it as a Custom HTML tag that fires on All Pages.

Tag Manager snippet
<script>
  window.localWrangler = { key: "lw_xxxxxxxx" };
</script>
<script src="https://localwrangler.com/track.js" async></script>

JavaScript app

For a React, Vue or other app bundled for the browser, where there is no static head to edit. Run this once when your app starts, in code that runs in the browser. If you use Next.js, see the Next.js section under Install on your platform.

JavaScript
// Run this once in the browser, before the tracker loads.
window.localWrangler = { key: "lw_xxxxxxxx" };

const s = document.createElement("script");
s.src = "https://localwrangler.com/track.js";
s.async = true;
document.head.appendChild(s);

Use your real key

The key above is a placeholder. Always copy the live snippet from your dashboard so the key matches a registered domain. An unregistered or paused key is rejected, and nothing is recorded.
Running several sites? Each domain gets its own key. With two or more active domains, the key in the snippet block becomes a dropdown so you can switch between them before copying.