Skip to main content

Install Measure

Add one script tag to count pageviews without cookies, then push registered event names. Only the hostname you allow can send data.

Samples run on , facts checked on

Create a Measure source

  1. Step 1. Ask your agent to create a source for the exact hostname of your site.

    Prompt text
    Create a Measure source named marketing site for the hostname www.example.com. Show me the browser token.
  2. 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.

layout.html html
<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

  1. Step 1. Ask your agent to register the event name. Measure drops names that are not registered.

    Prompt text
    Register the Measure event clicked_checkout for this project.
  2. Step 2. Push the name when the action succeeds.

    checkout.js javascript
    document.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

  1. Step 1. Load a page on the allowed hostname.

  2. 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.1 is not localhost. Ask your agent to allow the exact host, or *.example.com for 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.js for an hour. Change the v= 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.

Send your first signal today.

14 days free, no card required. Then $29 a month.

Start your 14-day free trial