Skip to content
Payment providers

Polar analytics with revenue attribution

2 min read · Updated · By the Reveata team

Short answerReveata imports Polar orders, refunds and subscriptions and receives new ones through a Polar webhook. Put the Reveata visitor id in the checkout metadata, which Polar copies onto orders and subscriptions, and each sale is credited to the visit that led to it.

Polar is popular with developers who sell software, subscriptions and digital products, and it is the merchant of record. Reveata adds what Polar's dashboard does not track: which visit, channel and campaign each order came from.

What you get

  • Paid orders as revenue, net of tax. Subscription cycles after the first are renewals and keep the first payment's source.
  • Refunds booked as negative revenue on the day they succeed, with the order's source.
  • MRR, churn, upgrades and downgrades from your Polar subscriptions, including subscriptions migrated to Polar from another provider.
  • Twelve months of history on connect.

Because Polar is the merchant of record, chargebacks are handled by Polar and are not taken out of your revenue in Reveata.

Two ways to connect

Connect with Polar Organization access token
Setup Approve in Polar Create a polar_oat_… token, paste it
Webhook Created for you Created for you with webhooks:write, otherwise added by hand
Scope One organization, picked on Polar's consent screen Exactly one organization

With OAuth, Reveata asks for read access to your organization, orders, subscriptions and refunds, plus webhook management for its own endpoint. An approval or token that covers several organizations is refused, so two businesses are never mixed. When you add the endpoint by hand, choose the Raw format in Polar. The API is described in Polar's API reference (opens in a new tab).

Reveata subscribes to order.paid, order.updated, order.refunded, refund.created, refund.updated and the subscription events (subscription.created, updated, active, canceled, uncanceled, revoked, past_due, paused, resumed and migrated).

How orders are matched to visits

Add the ids to the checkout metadata when your server creates the checkout:

js
const checkout = await polar.checkouts.create({
  products: [productId],
  successUrl: 'https://example.com/thanks',
  metadata: { reveata_visitor_id: visitorId, reveata_session_id: sessionId },
});

Reveata looks for reveata_visitor_id, reveata_session_id and reveata_user_id in the order's metadata, its custom field data and the customer's metadata. Get the ids from window.reveata.metadata() in the browser or from the _dt_v and _dt_s cookies on your server.

Checkout links you share without creating a checkout on your server carry no metadata. Those orders match by the buyer's email for visitors you identified. A success URL with ?checkout_id={CHECKOUT_ID} also works: the order is linked when it arrives, since Polar orders carry their checkout id.

Frequently asked questions

The webhook shows "None received yet". What is wrong?

Most often the endpoint's format is not Raw. Change it in Polar's webhook settings.

What happens when I disconnect?

Reveata deletes its webhook endpoints in Polar (when the token has webhooks:write) and revokes an OAuth approval. You choose whether to keep the imported data.

Can a webhook delivered twice add an order twice?

No. Each order is stored once under its Polar id, and duplicate deliveries are processed once.

See it with your own numbersReveata ties every visit and sale to the source that brought it. Add your website in a minute.
Get started
Was this page useful?
IntegrationDodo Payments analytics with revenue by sourceReveata connects to Dodo Payments with an API key and a webhook you add in Dodo, imports payments, refunds, disputes and subscriptions, and credits each payment to a visit through reveata_visitor_id in the checkout or payment metadata.IntegrationRevenue attribution for custom billing with the Payments APIIf your provider is not one Reveata connects to, or you bill customers yourself, post each payment to the Reveata Payments API with a website key. Include the visitor id, a user id or an email, and the payment is attributed like any connected provider's.IntegrationStripe Checkout analytics and attributionAdd the Reveata visitor and session ids to the metadata of each Stripe Checkout Session your server creates. When Stripe reports the payment, Reveata reads the ids and credits the money to the exact visit that started the checkout.IntegrationStripe Elements and PaymentIntent analyticsWhen your server creates a Stripe PaymentIntent for Elements, the Payment Element or a mobile app, put reveata_visitor_id and reveata_session_id in its metadata. Reveata reads them when payment_intent.succeeded arrives and credits the payment to that visit.IntegrationStripe Payment Links analytics without codeThe Reveata script adds the visitor and session ids to every Stripe Payment Link, Buy Button and Pricing Table on your pages as a client_reference_id. Stripe stores it on the payment, and Reveata uses it to credit the sale to the visit, with no code to write.IntegrationStripe revenue analytics by traffic sourceReveata reads your Stripe payments, invoices, subscriptions, refunds and lost disputes through a read-only connection, then credits each payment to the visit that brought the buyer, so revenue sits next to traffic in every report.