Installation
How do I set up Metrunio in WordPress and WooCommerce?
You install the “Metrunio” plugin in WordPress, click “Connect to Metrunio” under “Settings → Metrunio” and confirm the website in the portal. From then on the plugin measures visits and takes the consent decision from your consent tool. With WooCommerce it also reports orders, cancellations and refunds straight from the server.
How do I install and connect the Metrunio plugin for WordPress?
What you need
- WordPress 6.9 or newer with PHP 7.4 or newer. For orders, WooCommerce 11.0 or newer; without WooCommerce the plugin measures visits and campaigns.
- A Metrunio account with a website and a concluded data processing agreement. Before that, Metrunio accepts nothing.
- The website’s domain among the addresses of that website in Metrunio, as its main address or an allowed domain. The portal only returns there after authorisation. If your WordPress administration runs on a different domain, add that one too.
- A user account that may change settings, usually an administrator.
Setting it up
- 01Download the free “Metrunio” plugin in the portal under “Setup assistant”. Upload the file under “Plugins → Add New Plugin → Upload Plugin” and activate the plugin.
- 02Open “Settings → Metrunio” and click “Connect to Metrunio”. The portal opens: sign in, choose the website and confirm.
- 03You are taken back to WordPress. The status line names the connected website.
- 04Under “Consent”, check which tool the plugin has detected, or choose it yourself. Save.
- 05Open the website in a private window, accept in the banner and visit two pages. They appear in the live test in the portal.
In a multisite network you connect each website on its own. Each measures into the website you choose when connecting.
With Polylang or WPML and one domain per language, the plugin adds the domains of all languages as allowed domains when you connect, up to ten. If a language gets its own domain later, add it in the portal under “Setup → Websites and allowed domains” or connect again. Until then, Metrunio accepts nothing from that domain.
What the plugin measures
| What | From where | When |
|---|---|---|
| Page views and consent | snippet on every page of the website | only after the decision in the banner |
| Purchase, only with WooCommerce | from the server as soon as the order is placed: “Processing”, “On hold” or “Completed” | with consent, linked to the visits; without a decision in the banner with the order number, without browser, customer or advertising identifiers, not attributed; after a refusal the same, but only with an activated additional instruction for revenue reconciliation |
| Cancellation and refund, only with WooCommerce | from the server on the status change or the refund | a cancellation as a refund of the open amount, a partial refund for its amount |
| Subscription orders from WooCommerce Subscriptions (from 1.0.1) | from the server, with the subscription ID | the first order like any purchase; every renewal as a renewal without a decision and without identifiers, measured and never attributed |
| Link between purchase and visits | identifier from the session, which the plugin attaches to the order | only with consent for analytics |
An order counts as soon as it is placed, with the time someone clicked “Place order”. If it stays at “Pending payment”, for example because someone abandons payment at PayPal, it is not a purchase. That way the figures match WooCommerce Analytics.
Amounts go out in the order’s currency. The plugin takes the cost of goods from WooCommerce’s “Cost of Goods Sold” feature, but only if every product line has a value. If one is missing, the field stays empty.
When the portal shows a finding
| Finding | Cause | What you do |
|---|---|---|
| WORDPRESS_SNIPPET_INACTIVE | Measurement on the website is switched off in the plugin settings. Visits do not arrive; WooCommerce orders still do, but without the visits before them. | Switch it on under “Settings → Metrunio” and save. |
| WORDPRESS_REPORTS_STALLED | Order reports have been waiting in the shop for more than an hour. Usually WP-Cron is not running. | Check whether DISABLE_WP_CRON is set, and if so set up a cron job on the server. Orders that were not reported can be sent again from the plugin settings. |
Limits
- Without WooCommerce, the plugin does not report enquiries from forms. Create a goal step in the portal for them.
- Orders you create in the administration have no session and therefore no consent. They count towards revenue but are not attributed to any channel.
- The plugin does not report changes to an order after the purchase. A cancelled order you reopen stays refunded in Metrunio.
- If you refund an order after cancelling it, the plugin does not report the refund again. The cancellation has already refunded the open amount.
- A partial refund without selected lines has no split into net value and cost of goods. The order is then left out of the contribution margin totals; the reports say how many there are.
- With a multi-currency plugin, Metrunio converts foreign currencies at the daily rate, not at the plugin’s rate.
- Amounts go to Metrunio with two decimal places. In a currency with three, such as the Kuwaiti dinar, the third is rounded.
- Order reports run on WP-Cron. On a website without visitors, or with WP-Cron switched off and no cron job on the server, they wait.
- A renewal from WooCommerce Subscriptions is created without a visit. It goes out without a consent decision and is therefore never attributed. If one order starts several subscriptions (different billing periods in one cart), it carries no subscription ID.
- If the keys in
wp-config.phpchange, the plugin can no longer read its stored connection. Release the old connection in the portal under “Data connections” with “Release connection”, then connect again. Until then, Metrunio refuses a second connection for the same website. - Your data stays in Metrunio after an uninstall. If Metrunio cannot be reached while you uninstall, the connection remains. You then release it in the portal under “Data connections” with “Release connection”; the Admin role can do this.
- When you uninstall, Metrunio’s details on your orders stay in place (order meta
_metrunio: the visit and session identifiers and the consent state). They belong to the order in your shop, and if you install the plugin again, it reports refunds of earlier orders with their consent state. - If you copy the website including its database, for example for staging, the copy takes the connection with it. The plugin notices the different address and measures nothing there until you deactivate it. If you move the website, disconnect in WordPress after the move and connect again; you release the old connection in the portal under “Data connections”.
- With WPML the plugin reads the domains of the languages according to the WPML source code. After connecting, check under “Setup → Websites and allowed domains” whether all domains are listed, and add any missing ones there with “Add domain”.
Last reviewed on 16 Oct 2026
Overview
Code and consent on every page, with WooCommerce orders from the server too.
In the customer portal
Also asked
- What stays on my orders when I uninstall?
- Where do I get the WordPress plugin?
- WooCommerce plugin
- Download the WordPress plugin
- Install the WordPress plugin
- WooCommerce tracking plugin
- Add Metrunio to WooCommerce
- Connect WordPress to Metrunio
- Order reports from WooCommerce are stuck
- Measurement is switched off on the WordPress website
- Does the plugin work without WooCommerce?
- Does the plugin run in a multisite network?
- Does the plugin work with Polylang or WPML?
- Multilingual website with one domain per language
- When does a WooCommerce order count as a purchase?
- What happens to the plugin on a staging copy?
Related articles
- How does Metrunio take the decision from my consent tool?
Do I have to call metrunio.setConsent myself if I use Usercentrics, Cookiebot, Complianz, Borlabs Cookie, Real Cookie Banner or another common consent tool?
Through the consent bridge, without you calling
metrunio.setConsentyourself: for thirteen tools this small additional script reads the decision from your banner and passes it to Metrunio, including every later withdrawal. The installation code in the portal contains it as soon as you choose your tool in the consent step, and the Shopware plugin adds it by itself. - How do I connect my consent tool?
Which consent tools behind my cookie banner are supported, and how do I map the categories?
In “Setup” you select your consent tool, the tool behind your cookie banner; for the common systems the categories are pre-filled. Other CMPs and custom consent APIs can be mapped freely.
- Where do I install tracking in my shop system?
How do I install Metrunio in WordPress, Shopify, Shopware or Webflow?
For Shopify, Shopware 6 and WordPress with WooCommerce there is an extension that measures visits, consent and orders at once. The other systems have a place for custom head code; the table names the route per system. Without an extension, we additionally recommend the Server Events API for purchases, because it works independently of the browser.
- How do I report conversions server-side?
How do I send events from my shop, CRM or backend?
Through POST /v1/server/events to the collector, with the server key in the authorization header. The portal shows the address and the ready-made call for your website under “Setup” on the “Server Events API” tab. The call is independent of the browser and therefore robust against ad blockers and short-lived cookies.
- How do refunds reach Metrunio?
How do I report a refund, and how can I tell that it has been applied?
Your shop server reports a refund through the Server Events API as
refund, with the same order number, environment and currency as the purchase. Metrunio then reduces the value of that order. If it finds no matching purchase for 24 hours, it does not apply the refund and deletes it. Under “Data status”, the finding REFUND_WITHOUT_PURCHASE then counts how many there were per website and day, without order numbers. - How does Metrunio count subscription renewals?
How do I mark subscription renewals, and which channel are they attributed to?
You report a renewal as a purchase with the subscription ID (subscription_id) and the flag subscription_renewal; Metrunio marks renewals from Stripe itself. It counts in measured revenue, appears separately in the reports and receives the shares of the first order of the same subscription, because it has no ad contact of its own. Without a known first order or without consent, it stays unattributed with a reason.
- Why do I have to allow domains?
What does DOMAIN_NOT_ALLOWED mean and how do I add a domain?
The write key is visible in your page source; to stop a foreign website using it in its visitors’ browsers, the collector checks the origin of the request. If the domain is not in the allowed list, the event is rejected with DOMAIN_NOT_ALLOWED. A request from outside a browser is not stopped by this check, so it is best to report purchases from your server as well.
- What does the setup health centre do?
How do I find out what is missing in my setup?
The health centre runs a diagnosis across your setup and reports every finding with cause, effect, error code and the steps to fix it, rather than just an error message.