Aller au contenu

Les articles d'aide existent en allemand et en anglais. Vous les lisez ici en anglais.

Installation

How do I report conversions server-side?

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 I send events from my shop, CRM or backend?

MethodPathPurpose
POST/v1/server/eventsevents and conversions, signature optional
POST/v1/webhooks/conversionswebhooks, signature required

Authenticate with authorization: Bearer <SERVER_KEY> or the header x-metrunio-server-key. The server key has scope “server” and is bound to exactly one website. You create it in “Setup” on the “Server Events API” tab, where you also renew and revoke it.

You send to the collector, not to the product API. Its address appears on the same tab in the ready-made call for your website; the example below uses $METRUNIO_COLLECTOR in its place. If your own measurement domain is in operation, the tab shows it and the call goes there.

Example

curl -X POST "$METRUNIO_COLLECTOR/v1/server/events" \
  -H "authorization: Bearer $METRUNIO_SERVER_KEY" \
  -H "content-type: application/json" \
  -d '{
    "site_id": "site_demo_shop",
    "events": [{
      "event_id": "order-12345",
      "event_type": "purchase",
      "occurred_at": "2026-08-12T10:15:00Z",
      "order_id": "12345",
      "value": "149.90",
      "currency": "EUR",
      "consent_state": "granted",
      "consent_purposes": ["analytics", "marketing"]
    }]
  }'

Response

{
  "received": 1,
  "accepted": 1,
  "duplicates": 0,
  "rejected": 0,
  "blocked": 0,
  "results": [{ "eventId": "order-12345", "status": "accepted" }]
}

Partial failures are possible: one invalid event does not discard the whole batch. The response states a status per event and, on failure, the reason.

The event_id makes a report safe to retry: if the same event_id arrives again from a server for the same website and environment, it does not count twice and the response says DUPLICATE_EVENT. So derive it from your system, for example order-12345. Two websites, test and production may use the same event_id, and an event_id from the browser never takes up one of your server’s.

Linking to the journey

To connect the server-side conversion with website contacts, pass at least one shared identifier: anonymous_id, session_id, click_id or an already pseudonymised user_id. Without a shared identifier the conversion stays visibly “unattributed”; it is not guessed.

A funnel step of an application takes the same route: event_type: "goal" with goal_key and user_id, event ID such as customer-4711-shop_created. It counts once per customer; without a customer identifier it is rejected. An unknown key creates the definition in the portal automatically.

Report a subscription payment as a purchase with its own order number, plus subscription_id and subscription_renewal: true. It is attributed according to the first order of the same subscription and never counts as a new customer. The article on subscription renewals explains the details.

Caution

Consent applies server-side too. Pass consent_state and consent_purposes. For journeys and ad attribution an event needs matching consent; without it the event is rejected. The exception is purchases and refunds without a decision (unknown): they are stored for revenue reconciliation, without browser, customer or advertising identifiers, and appear as not attributed. After a refusal (denied) this applies only with the additional instruction for revenue reconciliation. The details are in the article on consent for server events.

Dernière vérification le 17 oct. 2026

Également demandé

  • Server-side tracking
  • Conversion API
  • Send events from the backend
  • How do I send an order or lead?
  • Which address do I send server events to?
  • What is the host of the Server Events API?
  • Does the event_id have to be unique across all websites?

Articles connexes

  • How do I sign server-side requests?

    How does the HMAC signature and replay protection work?

    Send the header x-metrunio-signature with a timestamp and an HMAC-SHA256 over "<timestamp>.<raw body>", computed with the server key. The time window is five minutes and each signature is accepted exactly once.

  • Can my system report conversions by webhook?

    When do I use the webhook instead of the Server Events API?

    The endpoint POST /v1/webhooks/conversions is meant for systems that fire a webhook of their own rather than letting you program an API call. It always requires a valid signature.

  • Why is a conversion not attributed?

    What does “unattributed” mean, and how do I improve coverage?

    “Unattributed” means the model found no touchpoint for this conversion that it considers. Either none falls inside the attribution window and is linked by a shared identifier, or there are only touchpoints of a kind the model does not distribute. Metrunio does not invent a contact in that case.

  • How do I report a funnel step?

    How do I send the steps of my funnel from the browser or the backend?

    In the browser with metrunio.identify(userId) once after sign-in and then metrunio.goal('key') per step; from the backend with POST /v1/server/events and an event of type goal carrying goal_key and user_id. Both routes are equivalent; a step without a customer identifier is rejected.

  • How do I measure over my own domain?

    How do I set up a custom measurement domain so ad blockers cost me less data?

    In “Setup” you enter a name such as gauge.your-domain.com, and Metrunio gives you three DNS records at once (two CNAME and one TXT). Once they are in place and a certificate has been issued for your name, the address goes live; with the snippet or Tag Manager you then switch your setup, while the Shopify app and the plugins for Shopware and WordPress switch themselves. Measurement then runs first-party and is cut less often by ad blockers and browser tracking protection.

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

Voyez ce que racontent vos données.

Explorez d’abord la démo. Un compte personnel n’est actuellement disponible que sur invitation.

Ouvrir la démoDemander un accès