Skip to content

Installation

How do I send cart, new customers and margin from my shop?

On checkout, tracker.conversion(…) and the Server Events API also accept newCustomer, the breakdown of the order value (netValue, taxValue, shippingValue, discountValue, costOfGoods) and the cart line items (items). All fields are optional; without them Metrunio measures as before. With them you get new-customer cost, contribution margin and product-level reporting.

How do I pass line items, the net value, the cost of goods and whether it was a new customer?

A 200 euro order says little on its own. Whether it came from a new customer, and how much is left after the cost of goods, decides whether the advertising was worth it. Your shop knows both; Metrunio does not. So you can send it along.

From the browser

metrunio.conversion({
  orderId: '12345',
  value: 238.00,          // what the customer pays
  currency: 'EUR',
  newCustomer: true,      // first order by this customer?
  netValue: 200.00,       // goods value excluding tax and shipping
  taxValue: 38.00,
  shippingValue: 0,
  costOfGoods: 80.00,     // cost of goods
  items: [
    { productRef: 'CHAIR-01', sku: 'CHAIR-01-BLUE', name: 'Nordlicht chair',
      quantity: 1, unitPrice: 200.00, unitCost: 80.00, lineValue: 200.00 },
  ],
});

Note

If your shop redirects to an external payment page, report the purchase server-side through the Server Events API, with the same fields and the same order number. Then report it only there, not from the browser as well.

What each field gives you

FieldWhat you get
newCustomerNew-customer cost: what a new customer cost, rather than only what an order cost
netValue and costOfGoodsContribution margin: the campaign is measured against what is left, not against revenue
taxValue, shippingValueROAS without tax and shipping in the numerator
itemsReporting by product, category and brand

Four rules worth knowing

  • Report each purchase with its order number. It then counts once per website, even when browser and server both report it. Value and currency come from the server as soon as it reports; “Data status” lists ORDER_ALREADY_COUNTED or, if the value differed, ORDER_VALUE_FROM_SERVER. Without an order number Metrunio recognises duplicates only by event_id, and that applies per route: the tracking script assigns its own, and even the same event_id from browser and server counts as two reports. The same purchase sent both ways then counts twice.
  • A cost of goods (costOfGoods) without a net value (netValue) is rejected. A margin on the gross value would count sales tax as profit. The message appears in the browser console immediately.
  • Metrunio does not calculate anything inside cart line items. If lineValue is missing it stays empty: two units at 25 euros are not necessarily 50 euros, and your discount is your calculation.
  • If you say nothing about newCustomer, Metrunio derives the answer from its own measurements and labels it as such (“measured” rather than “from the shop”). That is the weaker statement, because we do not know the time before the first measurement.

Refunds

Send a refund with the same order number and it reduces the value of the order. Include netValue and costOfGoods of the refunded part and the contribution margin stays correct. For a full refund the amount is enough: everything is back. For a partial refund without those figures Metrunio does not extrapolate the share: the order is excluded from contribution margin totals and reported there with a count.

How Metrunio matches a refund to its purchase, how long it waits for a purchase that has not arrived yet, and how you can tell that it has been applied is covered in “How do refunds reach Metrunio?”.

Note

All fields are optional. A shop that sends only an order number and an amount measures just as reliably as before. It simply misses the reports that rest on these figures.

Last reviewed on 17 Oct 2026

Also asked

  • Send cart data to Metrunio
  • Track order line items
  • Measure new versus returning customers
  • Contribution margin instead of revenue
  • ROAS on margin
  • Pass cost of goods
  • Product-level reporting

Related articles

  • 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 set up Metrunio in WordPress and WooCommerce?

    How do I install and connect the Metrunio plugin for WordPress?

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

  • What does a new customer cost me, and what is left?

    How do I see new-customer cost and contribution margin, and which products did a campaign sell?

    The “Commerce & products” area in the portal shows new-customer cost, margin ROAS, average order value, repeat purchase rate and a product report. The campaign filter only narrows the product report: the metrics above it always cover all campaigns. They appear as soon as your shop sends the matching figures; without them the metric in question stays empty. The overview and the “Attribution” page show the margin ROAS per channel and per campaign.

  • What does Metrunio deliberately not do?

    Which features are missing, and why?

    No fingerprinting, no marketing mix modelling, no ad server and no consent management of its own. The scope is deliberately narrow: measure, connect, attribute; whatever else you need is done by a tool built for it. There are no extrapolated figures, and every figure says where it comes from, such as measured or attributed.

See what your data tells you.

Look around in the demo first. Your own account is currently available by invitation only.

Open the demoRequest access