Install guides
Install on any HTML site
One tag in the <head> of each page. It works with hand-written HTML, static site generators and server-rendered templates alike.
Add the script tag
Paste the tag inside the <head> of every page, before the closing tag. Replace the write key with the one from your install panel.
<script defer
src="https://cdn-stg.webmetric.io/v1/b.js"
data-key="wm_w_your_write_key"
data-host="https://in-stg.webmetric.io"></script>defer downloads the script in parallel and runs it after the page is parsed, so it never blocks rendering. It is 5.1 KB gzipped.
Shared templates
If your pages share a layout, a header include or a base template, add the tag there once. Hugo, Jekyll, Eleventy, Astro and most server frameworks have one.
Options
You change the tracker’s behaviour with data- attributes on the same tag. This one keeps session replay off on the page and masks two more elements:
<script defer
src="https://cdn-stg.webmetric.io/v1/b.js"
data-key="wm_w_your_write_key"
data-host="https://in-stg.webmetric.io"
data-replay="false"
data-mask=".account-number, #address"></script>Every attribute is listed in the SDK reference.
Verify
Load a page of your site, then open Overview. The install panel confirms the first event. If nothing arrives, see troubleshooting.