Polar.sh + SuprAnalytics

See which channels bring your Polar.sh revenue

Polar handles the payment. SuprAnalytics shows where it came from: connect the two and every traffic source, campaign and page shows the Polar revenue it brought, with each customer's journey from first visit to payment.

14-day free trial · No card required · From $9/monthExplore the live demo

A customer's profile on the live demo: two visits, five pages, one payment of $79 through Polar, and a timeline from a Google search through sign-up to the Polar payment three days later.

Your payment tells you what sold. Attribution shows how they found you.

Polar records the order: the product, the amount, the customer. What it can't know is the Google search, the Reddit thread or the newsletter that brought that customer to your website three days earlier. SuprAnalytics does, when the checkout carries the visitor's id, and puts the two together.

Traffic alone doesn't tell you which channels pay. Attribution shows where paying customers came from, not that a channel caused the sale on its own, and not every payment can be matched to a visit.

SourceVisitorsPolar revenue
  1. Google1,200$180
  2. Direct800$90
  3. Reddit450$320
  4. X300$140
Example data. Reddit sends fewer than half of Google's visitors and brings nearly twice the revenue.

Connect Polar to your website analytics

About five minutes, most of it in Polar's settings. No code for checkout links; a few lines of metadata for checkouts created on your server.

  1. Website visit
  2. Polar checkout
  3. Polar payment
  4. SuprAnalytics revenue report
  1. Install the SuprAnalytics script

    One line in the <head> of your pages, or the guide for your platform. From then on every visit is recorded with its source, campaign and landing page, and each visitor gets an id.

  2. Add the webhook in Polar

    In Polar, Settings → Webhooks → Add Endpoint, in the Raw format, with the URL SuprAnalytics shows for your website and the events order.paid, order.updated and order.refunded.

  3. Paste the secret in SuprAnalytics

    Copy the endpoint's secret (whsec_…) into Settings → Revenue with Polar selected. It's how SuprAnalytics checks that every event really came from Polar. Both Polar secret formats work.

  4. Pass the visitor id to the checkout

    Polar checkout links need nothing: the script adds the id when a visitor clicks. For checkouts your server creates, pass it as metadata. The two methods are below.

  5. See attributed payments

    Each order arrives through the webhook, is tied to the visitor and their visits, and shows up on the dashboard, the live view and the customer's journey within seconds.

The visitor id, in plain English. The script keeps a random id in the visitor's browser (the supr_visitor_id cookie). When that id reaches Polar with the checkout, Polar copies it into the order's metadata, and the webhook brings it back. SuprAnalytics looks the id up, finds the person's visits, and the payment joins their journey. No id, no match: the payment still counts in your revenue, without a source.

The Polar setup guide

Works with your Polar checkout flow

Two ways to get the visitor id into the order. Use either, or both on the same website.

Polar checkout links

No code

A link to buy.polar.sh/polar_cl_… anywhere on your pages. When a visitor clicks it, the script adds ?reference_id=<their visitor id>; Polar copies it into the order's metadata.

  • Works on links added later too: the id is set at the click, not at page load
  • A link that already has a reference_id is left alone
  • Only a reference_id that is a visitor SuprAnalytics has seen is used, so your own reference ids are never mistaken for one
  • To stop the script touching links, add supr-polar="false" to it

Checkout links guide

Polar Checkout API

A few lines on your server

When your server creates the checkout, read the supr_visitor_id cookie from the request and pass it as metadata. supr_session_id is optional and credits the payment to that exact visit.

import { Polar } from "@polar-sh/sdk";

const polar = new Polar({ accessToken: process.env.POLAR_ACCESS_TOKEN });

app.post("/checkout", async (req, res) => {
  const checkout = await polar.checkouts.create({
    products: ["<product id>"],
    successUrl: "https://yourdomain.com/thanks",
    metadata: {
      supr_visitor_id: req.cookies.supr_visitor_id,
      supr_session_id: req.cookies.supr_session_id,
    },
  });
  res.redirect(303, checkout.url);
});

From the guide, which also has Next.js and Python. The metadata of the customer and the subscription is read as well, so renewals keep their attribution.

Checkout API guide

See which channels generate Polar sales

Is your Reddit traffic converting? Are newsletter readers becoming customers? Which campaign deserves next month's budget? Every breakdown shows the revenue beside the visitors.

The referrer report of the live demo sorted by revenue: Google, direct visits, ChatGPT, a newsletter, LinkedIn and X, each with visitors, bounce rate, session duration, customers, conversion rate, revenue and revenue per visitor.

By channel and referrer

Search, social, AI assistants, email, referrals and direct visits, and the websites behind them, each with its customers and revenue.

By campaign

UTM tags and ref links read on arrival, so a sponsored post or a newsletter issue gets its own revenue line.

By landing page, page and country

Which pages people arrive on and read before they pay, and where in the world they pay from.

Over time

Revenue on the traffic chart as its own series, new and renewals apart, with the period before to compare.

Conversion rate and revenue per visitor

The two numbers that rank channels fairly, on every row.

Filtered

Click any row and the whole dashboard, revenue included, narrows to it.

Understand the first visit and the converting visit

Most customers don't pay the first time they come. Pick, per website, which visit gets the credit.

  1. Mon · visit 1

    Finds you on Google

    Reads the pricing page, leaves

  2. Thu · visit 2

    Types your address in

    A direct visit

  3. Thu · visit 2

    Clicks a Polar checkout link

    Pays $79

An illustrative journey: one customer, two visits, one Polar payment.

First touch

The $79 is credited to

Google

The visit that first brought this person to your website, however long ago. Answers which channels find new customers.

Last touch

The $79 is credited to

Direct

The visit the payment happened in. A direct return counts as direct; SuprAnalytics doesn't skip it in favour of an earlier source. Answers which visits close. This is the default.

A checkout link carries the visitor id alone, so the last touch is the visitor's most recent visit before the payment. The Checkout API can add supr_session_id to name the exact visit. Someone who browses on one device and pays on another is two visitors until an email or your app's identify call joins them. More on attribution models

Understand more than the first payment

SuprAnalytics listens to Polar's order events, so a subscription's second month and a refund in its third are part of the same customer's story.

What arrives
Every order event Polar sends: paid, updated and refunded. Unpaid orders are ignored until they're paid; free orders are skipped.
What's stored
The order's net amount (after discounts, before tax: Polar is the merchant of record, so its tax isn't your revenue), the currency, whether it's a renewal, whether and how much was refunded, the customer's id, email and name, and the ids of the order, subscription, checkout and product.
Renewals
Orders with the billing reasons subscription_cycle, subscription_update and subscription_meter_cycle are marked as renewals and credited to the customer's original visit, through the subscription's or the customer's metadata.
Refunds
A full refund marks the payment refunded. A partial refund lowers it by the pre-tax amount refunded. Each order is stored once, so Polar's retries are safe.
What you see
A revenue figure split into new and renewals, revenue on every source, page and country, each customer's journey with their payments, lifetime value per customer and per segment, and a customers list.

Payments in other currencies are converted to your website's reporting currency with daily rates. This is attribution, not accounting: Polar's dashboard stays the record for invoices and payouts.

Renewals, refunds and currencies

The overview of the live demo: revenue of $50,897 split into new and returning beside visitors, conversion rate and revenue per visitor, with a daily chart showing revenue under the visitors line.

Understand the customer journey before the sale

A Polar payment is the last line of a story that started with a search, a few pages and maybe a question in the chat. SuprAnalytics keeps the whole story: the traffic, the visitor's journey, the goals they completed, the conversation, and the payment.

  • The visits, pages and goals before the payment, on one timeline
  • A chat conversation beside the visitor's analytics, so you know who's asking before you reply (live chat)
  • The payment on the same journey, with the product and the amount, when it carried the visitor id

Chat and payment meet on one journey when they come from the same tracked visitor, which is the same browser. A payment from elsewhere joins by the email Polar sends, when SuprAnalytics has seen it before.

Start tracking Polar revenue with SuprAnalytics

The Polar integration is part of every plan, for every website. The plans differ only in monthly analytics events, storage and how long data is kept.

  • Payments never count as events: only pageviews, goals and outbound clicks do
  • Unlimited websites, each with its own Polar webhook, attribution model and reporting currency
  • Every plan starts with a 14-day free trial, with no card. One trial per person.

Plans start at

$9 / month

100,000 analytics events a month, unlimited websites, every feature. Bigger allowances up to 5 million.

14-day free trial · No card required

Questions, answered.

How do I track Polar.sh revenue by traffic source?

Install the SuprAnalytics script on your website, add a webhook endpoint in Polar pointing at SuprAnalytics, and make sure the visitor id reaches the checkout: checkout links get it from the script when clicked, and checkouts your server creates take it as metadata. From then on every order is tied to the visits that led to it, and each source, campaign and page shows its revenue.

Does SuprAnalytics integrate with Polar.sh?

Yes, through Polar's webhooks (order.paid, order.updated and order.refunded), signed with your endpoint's secret. There's nothing to install on Polar's side beyond the endpoint, and SuprAnalytics never writes to your Polar account.

Can I track Polar checkout conversions?

Yes. The conversion rate and revenue per visitor appear on every source, page and country, and a funnel can end at a payment step, so you can see how many people reached the checkout link and how many paid. A goal fired when the link is clicked (checkout_started, say) fills in the step before it.

Does SuprAnalytics support Polar checkout links?

Yes, with no code. When a visitor clicks a buy.polar.sh link on your website, the script adds ?reference_id=<visitor id>; Polar copies it into the order's metadata and the webhook brings it back. The webhook has to be set up first, links that already carry a reference_id are left alone, and supr-polar="false" turns the tagging off.

Can I use the Polar Checkout API?

Yes. When your server creates the checkout, pass the supr_visitor_id cookie as metadata, and optionally supr_session_id to name the exact visit. SuprAnalytics also reads the subscription's and the customer's metadata, so renewals keep their attribution. The guide has Node.js, Next.js and Python examples.

Can I track Polar subscription renewals and refunds?

Yes. Orders with a subscription billing reason are marked as renewals and credited to the customer's original visit. A full refund marks a payment refunded; a partial refund lowers it by the pre-tax amount refunded. Lifetime value includes both.

How does first-touch and last-touch attribution work?

First touch credits a payment to the visit that first brought the customer to your website. Last touch, the default, credits the visit the payment happened in, even a direct one. It's a setting per website, and every report recalculates when you change it.

Does every Polar payment automatically receive a traffic source?

No. A payment gets a source when its order carries a visitor id SuprAnalytics knows: from a tagged checkout link, from Checkout API metadata, or from the subscription's or customer's metadata for a renewal. Failing that, it's matched by a customer id or email SuprAnalytics has seen before. An order with none of those, such as one from a Polar storefront page a visitor reached without passing through your website, still counts in your revenue, without a source. In cookieless mode the visitor id changes daily, so a payment is tied to that day's visit.

Know where your Polar revenue comes from

Connect your Polar payments with website analytics and see which channels bring paying customers.

14-day free trial · No card requiredHow revenue attribution worksEvery feature, on every plan