WysLeap
WysLeap Docs

Purchases and revenue

Send one purchase event per order to see revenue, orders and average order value in WysLeap.

WysLeap reports revenue only from orders your shop sends. It never estimates revenue, so the Revenue page stays empty until the first purchase arrives.

Send a purchase

Call this once per order, on the order confirmation page (or wherever your shop knows the order is placed):

WysLeap.trackEvent('purchase', {
  orderId: 'A-10492',   // required: your order number
  value: 84.50,         // required: the order total you charge
  currency: 'USD'       // required: three-letter ISO 4217 code
});
FieldRequiredRules
orderIdYesText or a number, up to 64 characters. GA4's transaction_id works too.
valueYesA number above 0: the order total, in units (84.50, not 8450 cents).
currencyYesThree letters, such as USD, EUR or GBP.
itemsNoThe products in the order (below).

The event name must be exactly purchase.

Each order counts once

A purchase with an orderId the site already sent is not counted again. A customer who reloads the thank-you page, or a tag that fires twice, won't double your revenue.

Items (optional)

Include the products in the order to see them in the Products section of the Revenue page: revenue and units per product, how often a product's page leads to an order, and which products are bought together. Up to 50 items per order are kept, with the keys shown below; other keys are dropped.

WysLeap.trackEvent('purchase', {
  orderId: 'A-10492',
  value: 84.50,
  currency: 'USD',
  items: [
    { id: 'SKU-221', name: 'Trail runner', price: 42.25, quantity: 2, category: 'Shoes' }
  ]
});

GA4 item keys (item_id, item_name, item_category) are accepted too.

A product page is matched to its product when the last part of the page address is the product's name or id written as a slug: /products/trail-runner for "Trail runner", or /p/sku-221 for id SKU-221. Lines without a price count toward units but not revenue.

Repeat customers

The Revenue page also shows how often customers come back: the share who bought again, the median time to a second order, and revenue per buyer by the month of their first order and by how they first arrived.

This needs to know when two orders come from the same person, so it counts only customers your shop identifies with WysLeap.identify(userId) at login or checkout (see Known people). Without that, one customer on a phone and a laptop looks like two. Figures appear once 30 identified customers have ordered, with a note saying how many orders they're based on. Revenue per buyer is what customers have actually paid; WysLeap doesn't predict lifetime value.

Don't send personal data

Leave out names, email addresses, phone numbers and addresses. If a purchase includes keys like email, phone, address or firstName, WysLeap drops them before storing the order.

Purchases that aren't counted

A purchase that fails a rule is stored but left out of revenue, and the Revenue page says how many and why:

  • no orderId
  • no usable value (missing, 0, negative, text or over 1,000,000)
  • no three-letter currency

Purchases from bots aren't counted either.

How long orders are kept

Orders are kept for 13 months, one month longer than other events, so repeat purchases can cover a full year. After 12 months an order is reduced to the order itself (its ID, value, currency and items), when it happened and, for an identified customer, the ID they're counted as. The IP, device, page, campaign and browser ID are removed. Orders are deleted at 13 months, the same time identities expire.

Currencies

Each site reports in one currency. The first time, WysLeap uses the currency most of your orders arrive in; an editor can change it on the Revenue page. Orders in other currencies are converted at that day's ECB reference rate.