Splitlab home

Book a Demo

Splitlab home

Book a Demo

Splitlab home
Server-side revenue API logo

Server-side revenue API

Report purchases from any store or backend and have Splitlab credit them to the variant the buyer saw, with no ad blocker losses.

Send a purchase to Splitlab from your server after payment succeeds, and Splitlab credits the revenue to the variant the buyer saw. Use it for any store or backend that Splitlab has no ready-made integration for. The WooCommerce integration is built on this API. Server-side reporting survives ad blockers and closed tabs, but your server has no visitor context of its own, so you pass the buyer's Splitlab visitor ID with each purchase.

What Splitlab tracks
  • Purchases with an amount, currency and your own order ID

  • Each order ID once: reporting the same order again does not count twice

  • Optional extra data, such as the page where the purchase completed or a specific revenue metric

How it works
  1. The Splitlab snippet assigns each visitor to a variant and stores their visitor ID in the first-party cookie mvtVisitorId_<projectKey>_cookie. Your checkout reads it and stores it with the order.

  2. After payment succeeds, your server sends POST https://api.splitlab.io/api/v1/track/revenue with the visitor ID, project key, amount, currency and order ID, authenticated with an x-api-key header.

  3. Splitlab credits the purchase to the variant that visitor saw and returns whether it was attributed, so your report compares revenue per visitor across variants.

Set it up
  1. In Splitlab, open Workspace settings → API keys and create a key. Choose Never for expiry on keys used by integrations. Keep the key on your server.

  2. At checkout, read the visitor ID from the cookie mvtVisitorId_<projectKey>_cookie and store it with the order. Capture it at checkout, not at payment: payment webhooks have no cookies.

  3. After payment, send a request with visitorId, projectId (your project key), campaignId (send "" to let Splitlab find the test), revenueAmount in normal units such as 49.99, currency as an ISO 4217 code, and a unique orderId.

  4. Check the response. attributed: true means the revenue was credited to the visitor's variant; deduplicated: true means that order was already reported.

Good to know
  • The key must belong to the same workspace as the project you report into. A key from another workspace gets 403, and a missing, revoked or expired key gets 401.

  • Retrying a request that already succeeded is safe, because each orderId counts once.

  • Refunds cannot be reported through this API yet. A refunded order still counts in Splitlab.

  • If your project requires cookie consent, the visitor cookie only exists once the visitor has consented.

  • Never put the API key in browser code.

Start testing with Splitlab, or book a demo and we will walk you through the setup.


Start optimizing for revenue today not just conversion rates.

Run experiments, track revenue per variation, and scale what actually makes you money.

We’ll increase your conversion rate by 30% or you don’t pay. Terms apply.


Start optimizing for revenue today not just conversion rates.

Run experiments, track revenue per variation, and scale what actually makes you money.

We’ll increase your conversion rate by 30% or you don’t pay. Terms apply.


Start optimizing for revenue today not just conversion rates.

Run experiments, track revenue per variation, and scale what actually makes you money.

We’ll increase your conversion rate by 30% or you don’t pay. Terms apply.