/Docs
Register

Transactions

Record purchases, paid upgrades, or other revenue-like conversions from the same lightweight tracker.

Track a transaction

The browser tracker exposes window.openrevenue.transaction(). Pass a stable name, and optionally an amount in major units with an ISO currency code.

checkout-success.ts
window.openrevenue.transaction("checkout_completed", {  amount: 49.99,  currency: "USD",})
eventName

string

The transaction label stored with the event.

amount

number?

Optional purchase amount in major units (e.g. 49.99). Stored as minor units server-side.

currency

string?

Optional ISO 4217 currency (e.g. USD). Required when amount is set; defaults to USD if omitted with an amount.

type

"transaction"

The tracker sends transaction events with the transaction event type automatically.

path

string

The current page path where the transaction was recorded.

sessionId

string

The browser session ID associated with the conversion.

When to call it

Call transactions only after the payment, upgrade, or conversion has succeeded. The safest place is usually a success page or a client-side callback after your server confirms the purchase.

Do not call transaction tracking before payment confirmation. Otherwise abandoned checkouts can look like revenue.

Examples

success.tsx
useEffect(() => {  window.openrevenue.transaction("pro_upgrade", { amount: 29, currency: "USD" })}, [])
checkout.ts
if (checkout.status === "complete") {  window.openrevenue.transaction("checkout_completed", {    amount: checkout.total / 100,    currency: checkout.currency,  })}
name-only.ts
// Still valid — name only, no amountwindow.openrevenue.transaction("newsletter_signup")

Amounts vs payment providers

Tracker transactions store the event name, optional amount/currency, and visit context. They do not replace payment-provider webhooks — connect Stripe, Polar, or another provider with Revenue integrations for order-level attribution, refunds, and MRR-style reporting. Avoid double-counting the same sale in both places.

Tracker amounts show up on the project Events page and Goals → Events tab (and GET /events). Use Revenue integrations when you already have a payment provider for order-level attribution, refunds, and MRR-style reporting.