Skip to main content

Revenue Tracking

Ovyxa attributes revenue to the traffic sources, pages, and campaigns that generated it. Every stats view — sources, pages, countries, devices — shows revenue alongside visitors so you can see what actually drives paying customers.

Revenue Dashboard Metrics

Once revenue data flows in, you get:

  • Revenue Per Visitor (RPV) — total revenue divided by unique visitors, shown in the overview.
  • Revenue by Source — which referrers, UTM campaigns, and channels generate the most revenue.
  • Revenue by Page — which landing pages lead to purchases.
  • Revenue by Country / Device — geographic and device breakdowns with revenue columns.
  • New vs Refund — the timeseries chart separates new revenue from refunds.

Stripe Setup

  1. In your Stripe Dashboard, go to Developers → Webhooks → Add endpoint.
  2. Set the endpoint URL to:
https://api.ovyxa.com/api/v1/webhooks/stripe
  1. Select these events:

    • checkout.session.completed
    • charge.refunded
    • invoice.paid
  2. Copy the Signing Secret (whsec_...) and paste it into your Ovyxa site settings under Revenue → Stripe.

  3. Ovyxa matches Stripe sessions to visitors via the session_id URL parameter (see Payment Link Auto-Detection below).


LemonSqueezy Setup

  1. In your LemonSqueezy dashboard, go to Settings → Webhooks.
  2. Set the webhook URL to:
https://api.ovyxa.com/api/v1/webhooks/lemonsqueezy
  1. Select events: order_created, order_refunded.
  2. Copy the signing secret into Ovyxa site settings under Revenue → LemonSqueezy.

Paddle Setup

  1. In Paddle, navigate to Developer Tools → Notifications.
  2. Add a new notification destination with URL:
https://api.ovyxa.com/api/v1/webhooks/paddle
  1. Subscribe to: transaction.completed, transaction.payment_failed, adjustment.created.
  2. Enter the webhook secret in Ovyxa site settings under Revenue → Paddle.

Polar Setup

  1. In Polar, go to Settings → Webhooks.
  2. Add the endpoint:
https://api.ovyxa.com/api/v1/webhooks/polar
  1. Subscribe to: order.created, refund.created.
  2. Save the secret in Ovyxa site settings under Revenue → Polar.

Custom Payments API

If you use a payment provider Ovyxa does not natively support, send payment data directly:

curl -X POST https://api.ovyxa.com/api/v1/stats/payments \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"site_id": "example.com",
"amount": 4900,
"currency": "USD",
"visitor_id": "abc-123-def",
"timestamp": "2026-03-04T12:00:00Z",
"event_name": "Purchase",
"metadata": { "plan": "growth" }
}'
  • amount is in cents (4900 = $49.00).
  • visitor_id ties the payment to a tracked visitor (from the ovyxa_vid cookie or localStorage).
  • To record a refund, send a negative amount or include "type": "refund".

JavaScript API

Track revenue directly from the frontend with a custom event:

<script>
ovyxa('event', 'Purchase', {
revenue: { amount: 49.00, currency: 'USD' },
props: { plan: 'growth', method: 'credit_card' }
});
</script>

The revenue object accepts amount (number) and currency (ISO 4217 code). Revenue events appear in both the Events report and all revenue breakdowns.


When a visitor returns from a checkout page with a session_id or checkout_session_id URL parameter, Ovyxa automatically captures it and ties it to the visitor session:

https://example.com/thank-you?session_id=cs_live_abc123

The tracking script reads this parameter on page load, stores it, and sends it with the pageview event. When the corresponding Stripe (or other provider) webhook fires, Ovyxa matches the checkout session to the visitor who started it — completing the attribution loop.

No extra code is required. Just make sure your checkout success URL includes the {CHECKOUT_SESSION_ID} template variable.


Troubleshooting

ProblemSolution
Revenue not showingCheck that the webhook secret matches and events are selected
Revenue not attributed to a sourceEnsure the visitor completed at least one pageview before checkout
Duplicate paymentsOvyxa deduplicates by provider transaction ID automatically
Wrong currencyAll amounts are converted to your site's base currency using daily exchange rates