See which pages / referrers / countries actually drive money, not just visits. Works on both modes.
0) Prerequisite
Base script installed and window.owt available (see Events). Revenue is just a special event.
Basic
// €29 purchase
window.owt.trackPayment(29.00);
// with currency + order id (recommended)
window.owt.trackPayment(149.99, 'EUR', 'txn_1234567890'); Call it after payment succeeds: Stripe checkout.session.completed, Lemon Squeezy webhook, or your thank-you page.
// Stripe example (client success page)
if (searchParams.get('success')) {
window.owt.trackPayment(order.total, order.currency, order.id);
} API reference
window.owt.trackPayment(amount, currency, transactionId, callback) | Param | Type | Required | Details |
|---|---|---|---|
amount | number | Yes | e.g. 49.99 - rounded to cents |
currency | string | No | ISO code, default USD (EUR, GBP…) |
transactionId | string | No | Your order/txn id - deduplicates |
callback | function(status) | No | 200 on success |
Where it shows up
Dashboard → Revenue → breakdowns by:
- Source - Google, Twitter, newsletter
- Page - which landing page sold
- Location - country / region / city
- Device / Browser / OS
- Campaign - UTM
source/medium/campaign
Filter by date, compare periods.
Tips
- One call per purchase. Don’t call on page reload - guard with
sessionStorageif needed. - Currency must match website setting or it will be converted/displayed as sent - check Website → Settings → Currency.
- Test: use
1.00→ should appear in Revenue in seconds.
// guard against double-fire
if (!sessionStorage.getItem('paid-' + order.id)) {
window.owt.trackPayment(total, 'USD', order.id);
sessionStorage.setItem('paid-' + order.id, '1');
} Server-side (optional)
Prefer to track from backend? Use API / webhook: POST payment to your app → then fire this JS from a thank-you page, or via our API (coming soon - for now JS is source of truth).
→ Questions? See Events for validation, or API to pull revenue via code.