Create a Measure source
-
Step 1. Ask your agent to create a source for the exact hostname of your site.
Prompt textCreate a Measure source named marketing site for the hostname www.example.com. Show me the browser token. -
Step 2. Copy the token from the response. It starts with
msr_. The token is public; the hostname allow list decides which pages can send data.
Add the script
Place this before the closing body tag on every page. The script records the first pageview and later browser navigation.
<script>
window.postdeployMeasure = window.postdeployMeasure || [];
</script>
<script
defer
src="https://ingest.postdeploy.dev/m.js?token=YOUR_MEASURE_TOKEN&v=20260910"
></script>
Count a named action
-
Step 1. Ask your agent to register the event name. Measure drops names that are not registered.
Prompt textRegister the Measure event clicked_checkout for this project. -
Step 2. Push the name when the action succeeds.
checkout.js javascriptdocument.getElementById("checkout").addEventListener("click", function () { window.postdeployMeasure.push(["event", "clicked_checkout"]); });
A name has 1 to 64 characters: lowercase letters, digits, _ and -. Measure discards event properties.
Verify
-
Step 1. Load a page on the allowed hostname.
-
Step 2. Open Measure. The title reads "1 pageview in the last 24 hours" and the current hour bar shows it in progress.
Troubleshoot
- The network tab shows 204 and nothing is counted
-
The page hostname is not allowed.
127.0.0.1is notlocalhost. Ask your agent to allow the exact host, or*.example.comfor subdomains. - Pageviews count but events do not
- The event name is not registered. The server rejects it, and the page cannot see the response. Register the exact name.
- One browser sends nothing
- The script does not send when Do Not Track is on. Test with it off.
- A script change does not reach visitors
-
Browsers cache
m.jsfor an hour. Change thev=value in the script URL.
Limits
- Measure does not evaluate or display goals.
- Measure sets no cookies and keeps no visitor identifier across days, so it cannot report returning visitors.