Les articles d'aide existent en allemand et en anglais. Vous les lisez ici en anglais.
Installation
How do I report purchases through Stripe or PayPal?
Without writing code, on every plan: under “Data connections → Payment providers” you add a connection and enter the address Metrunio gives you as a webhook at Stripe or PayPal. Purchases and refunds then come from the payment provider; a purchase is attributed if it carries the reference from the SDK.
Can Metrunio take purchases straight from Stripe or PayPal without me writing code?
For everyone whose purchase ends at Stripe or PayPal: courses, software, services, small shops without a shop system. Metrunio accepts the payment provider’s webhooks, checks their signature and reads amount, currency, time and refunds from them.
Stripe
- 01In the portal, add a connection for Stripe and your website under “Data connections → Payment providers”. Metrunio shows you an address.
- 02In Stripe, add an endpoint with this address under “Developers → Webhooks” and choose the events checkout.session.completed, checkout.session.async_payment_succeeded, invoice.paid and refund.created. Without invoice.paid, your subscription renewals are missing.
- 03Copy the endpoint’s signing secret (starts with whsec_) and enter it on the connection. Only then does Metrunio accept messages.
PayPal
- 01In the portal, add a connection for PayPal and your website.
- 02In your app in the PayPal developer area, add a webhook with the address under “Webhooks” and choose PAYMENT.CAPTURE.COMPLETED and PAYMENT.CAPTURE.REFUNDED.
- 03Copy the webhook ID and enter it on the connection. Metrunio checks every message against the certificate PayPal signs with.
So that purchases are attributed
A purchase lands in the journey if it carries the reference from the SDK. With consent to analytics it contains the visitor ID, the session and the consent state. If someone declined or withdrew consent in the banner, it carries only that status (mtr1_d) and no ID. Before any decision there is no reference.
- Stripe Payment Links, Buy Buttons and Pricing Tables: nothing to do. The SDK sets the reference itself as client_reference_id. If you already use the field yourself, your value stays; what that means for your purchases is explained below.
- Stripe Checkout with your own code: pass client_reference_id: metrunio.paymentReference() when you create the session (handed from the browser to your server).
- PayPal buttons: pass purchase_units[0].custom_id: metrunio.paymentReference() when you create the order.
// Browser: get the reference and hand it to your server
const reference = metrunio.paymentReference(); // null until a decision is made
// Server (Stripe Checkout)
const session = await stripe.checkout.sessions.create({
mode: 'payment',
line_items: [...],
success_url: 'https://www.example.com/thanks',
...(reference ? { client_reference_id: reference } : {}),
});With no reference at all, the purchase still counts: as measured revenue, not attributed, like any order without a consent decision. Do not also report the same purchase from the browser; the order number is the payment at Stripe or PayPal, and a second report with a different number would count twice.
If your shop uses the field itself
If client_reference_id at Stripe or custom_id at PayPal carries a value of your own shop, the reference from the SDK is missing. Whether the customer declined in the banner cannot be determined then. Metrunio therefore treats such a purchase like one after a refusal: with the additional instruction for revenue reconciliation activated, it counts as measured revenue without any ID and is never attributed. Without it, Metrunio does not accept the purchase. The payment connection in the portal then shows a notice with the date of the last such purchase. Only that date is stored for this, not your value. If you want to see these purchases, give the additional instruction or pass the reference from the SDK instead of your own value.
After a refusal or withdrawal
- If the purchase carries mtr1_d, it counts as an order after a refusal. With the additional instruction for revenue reconciliation activated, it counts as measured revenue without any ID and is never attributed. Without it, Metrunio does not accept the purchase, and the connection’s log shows it as rejected.
- If someone withdraws consent in the banner, the SDK replaces the reference on Payment Links, Buy Buttons and Pricing Tables with mtr1_d. If you fetch the reference in your own code, ask for it when you create the checkout, not when the page loads.
- If the checkout was created with consent and the payment only arrives after the withdrawal (for example by direct debit), Metrunio does not accept the purchase. It does not go into revenue reconciliation as an order without a decision either.
- A refund carries no reference. It is booked against the payment without any ID and only changes a purchase that Metrunio accepted.
- If Metrunio rejected the purchase, it also discards its refund: the refund is not stored, does not appear under “Data status” and does not turn the connection red. The connection’s log lists it as “does not count”, without an order number. For this, Metrunio keeps only a checksum of the payment for 180 days when it rejects the purchase, not the payment itself. If the refund arrives before the purchase, it waits without any ID until the next processing attempt and is deleted then.
- Two exceptions: if the refund only arrives after those 180 days, or names a different identifier than the purchase (such as only the charge), Metrunio does not recognise the rejected purchase. The refund then waits 24 hours without any ID for a purchase like every refund, is deleted afterwards and only counted under “Data status”, without an order number.
- A rejection after a refusal or withdrawal is intended. The log lists it as “rejected”, but the connection does not show an error because of it.
Legal note
Whether you may have purchases after a refusal processed for revenue reconciliation is your decision as the controller. The additional instruction is the basis for this in your contract with Metrunio; it does not replace a review of your legal basis.
What is read and what is not
- Read: the payment ID, amount, currency, time, for Stripe also tax, shipping and discount, the subscription ID and the reason for an invoice, and the reference.
- Not read: names, email and postal addresses, payment and card details. The message itself is not stored.
- The connection’s log shows the last 50 messages with type, outcome and amount, without order numbers, and keeps them for 30 days.
- Paid checkout sessions count, including the first payment of a subscription, and completed PayPal payments. A checkout without an amount (such as a trial) does not count.
- Since 16 October 2026, subscription renewals count as renewals (invoice.paid with billing_reason subscription_cycle): measured and shown separately in the reports, but not attributed to a channel, because an invoice carries no reference from the browser. Other invoices, for example after a plan change, do not count, and neither do subscriptions through PayPal. The article on subscription renewals has the details.
- With Stripe, a direct debit counts only once it is paid (checkout.session.async_payment_succeeded).
- Metrunio does not always find refunds of a subscription payment, because Stripe books them against a different payment than the checkout session. After 24 hours without a purchase Metrunio deletes them and only counts them per day under “Data status” (REFUND_WITHOUT_PURCHASE), without order numbers.
- Metrunio matches a refund via the payment intent, even if Stripe only includes it in the charge. If a refund names only the charge, it finds no purchase: the checkout session does not name the charge, and Metrunio does not query Stripe. This affects payments without a payment intent, which Stripe Checkout does not create.
- One webhook per website and provider. Several websites with one Stripe account need one endpoint each.
Dernière vérification le 16 oct. 2026
Dans le portail client
Également demandé
- Connect Stripe
- Connect PayPal
- Stripe webhook Metrunio
- Payment Link tracking
- Stripe Checkout conversion
- Measure purchases without a shop system
- client_reference_id
- What happens to a Stripe purchase after someone declines in the cookie banner?
- What does mtr1_d mean?
- I already use client_reference_id myself. What happens to my purchases?
- Why does the payment connection show a notice about my own reference?
- What happens to the refund of a rejected purchase?
- Do subscription renewals from Stripe count?
Articles connexes
- 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.
- What does the tracking SDK offer?
Which JavaScript calls are available?
The SDK provides init, setConsent, page, track, identify, conversion, goal and reset, plus paymentReference for Stripe and PayPal, fillForm for forms, and renderSurvey and survey for the post-purchase question. It loads asynchronously, queues calls made before it loads, and sends events in batches.
- 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 happens before consent?
Can I measure anonymously before consent?
The default is “block_all”: nothing is stored before consent, and the tracking script sends nothing. Anonymous reach measurement before consent has been hidden since 29 September 2026 and can no longer be selected: the script sends nothing before a decision anyway, so it would stay empty. If you had already enabled it, earlier figures remain visible under “Reach”.
- Additional instruction for revenue reconciliation
When do orders count after a refusal in the cookie banner?
Orders your shop reports server-side after a refusal in the banner only count if the additional instruction for revenue reconciliation is activated for your account. You fill it in and sign it, and then we activate it; without it Metrunio rejects such orders. Orders with no decision in the banner at all count even without the instruction.
- 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.