measuremy.site

How to add analytics to your WordPress site

This adds measuremy.site, cookieless website analytics, to a WordPress site. It is one script tag of under 1 KB: no cookies, no npm package, no consent banner for the tracker. The free plan covers 5,000 pageviews a month.

The quickest way: ask your coding agent

Paste this into Claude Code, Cursor or Codex
Add measuremy.site analytics to this project: connect the measuremy.site MCP server at https://a.measuremy.site/mcp (it signs in with OAuth, no key), then tell me how to sign in. Details: measuremy.site/llms.txt

The agent connects to measuremy.site, you sign in through your browser, and it adds the tag below to the right file for you. To do it by hand, follow the steps.

1. Get your site key

Create a free account and add your domain. The Setup tab shows your snippet with your site key filled in. The key is public and can only record visits, so it is safe in your source code.

2. Add the script tag

Easiest, no code: install a header-code plugin such as WPCode, add a snippet for the Header, paste the tag and save.

With a child theme: add this to the child theme's functions.php, so a theme update doesn't remove it:

add_action('wp_head', function () {
    echo '<script defer src="https://a.measuremy.site/t.js" data-key="YOUR_SITE_KEY"></script>';
});

Don't paste it into the parent theme's header.php: theme updates overwrite that file. If you use a caching plugin, clear its cache afterwards.

3. Check it works

Publish the change, then open your live site. The first visit from your own domain verifies it and the visit shows up on the dashboard within seconds. Visits from localhost aren't counted, so test on the deployed site.

4. Track signups and other conversions

Add data-measuremysite-event to a button or form in the block editor's Custom HTML block, or under Advanced → Additional attributes if your form or block plugin supports it. A form is tracked when it is submitted.

Any event counts as a conversion for the channel the visitor came from.

WooCommerce: to count purchases, call measuremysite.track("purchase") on the order-received page from your theme, for example inside a woocommerce_thankyou hook that outputs a small script.

Other platforms, and funnels and campaign links, are in the install guide.

Try it on your site

Free for 5,000 pageviews a month, no card. Paste one sentence into your coding agent, or add one script tag yourself.

Start free See the live demo

Add measuremy.site analytics to this project: connect the measuremy.site MCP server at https://a.measuremy.site/mcp (it signs in with OAuth, no key), then tell me how to sign in. Details: measuremy.site/llms.txt

More guides