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.
window.openrevenue.transaction("checkout_completed", { amount: 49.99, currency: "USD",})window.openrevenue.transaction("checkout_completed", { amount: 49.99, currency: "USD",})eventNamestring
The transaction label stored with the event.
amountnumber?
Optional purchase amount in major units (e.g. 49.99). Stored as minor units server-side.
currencystring?
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.
pathstring
The current page path where the transaction was recorded.
sessionIdstring
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.
Examples
useEffect(() => { window.openrevenue.transaction("pro_upgrade", { amount: 29, currency: "USD" })}, [])useEffect(() => { window.openrevenue.transaction("pro_upgrade", { amount: 29, currency: "USD" })}, [])if (checkout.status === "complete") { window.openrevenue.transaction("checkout_completed", { amount: checkout.total / 100, currency: checkout.currency, })}if (checkout.status === "complete") { window.openrevenue.transaction("checkout_completed", { amount: checkout.total / 100, currency: checkout.currency, })}// Still valid — name only, no amountwindow.openrevenue.transaction("newsletter_signup")// 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.