Track Stripe revenue without Google Analytics

How-to · Updated 28 November 2026

TL;DR

Stripe revenue stays invisible to Plausible and Umami until your Next.js success page sends a goal. Call plausible('Purchase', { revenue }) or umami.track() with revenue and currency. A webhook records the charge. Plausible will not attach that server event to the visit.

The calls below match vendor docs read on 28 November 2026. Pick the browser event or the success-page POST. Sending both counts the payment twice. Compare hosts on the Plausible alternatives list before you turn on a revenue goal.

License
$59 once
Refund
7-day no-questions refund
Stack
Next.js 16, shadcn/ui, Recharts, Postgres, Drizzle, Clerk, optional Stripe

On this page

Why does cookieless analytics miss Stripe revenue?

Plausible, Umami, Fathom, and Simple Analytics record the page the browser loaded. Stripe Checkout runs on Stripe's host. The charge lives on the Checkout Session, not in the pageview.

A cookieless script has no Stripe account and no order table. It sees a hit only when your page, or your server, sends one. Until that call exists, the dashboard can show the pricing page and still show zero revenue.

Google Analytics also needs a purchase event before it can show the charge. A cookieless script has the same gap. The Next.js install for Plausible and Umami covers next/script and route changes. This page starts after that snippet is on the site.

Vendor docs read on 28 November 2026 put the amount in different fields:

ToolFieldUnitWhere it is documented
Plausiblerevenue.amount and revenue.currencyMajor unit, uppercase ISO codeEcommerce revenue page, Business plan
Umamitrack() data revenue and currencyNumber in the major unitRevenue doc since v2.14.0
FathomtrackEvent options _valueCents, so 1000 means $10.00Ecommerce conversions page
Simple Analyticssa_event metadata, such as usdA number you name yourselfMetadata page, no revenue object

How do you send a Plausible revenue goal after Checkout?

Create the goal before the first sale. In site settings, open Goals, add a goal, and choose Custom event. Name it Purchase. Turn on revenue tracking and set the base currency. Plausible says that currency cannot be changed later. The goal name is case-sensitive.

Plausible's ecommerce page says revenue tracking is a Business plan feature. The install guide on this site records that Community Edition leaves ecommerce revenue goals on Cloud. A self-hosted CE dashboard will not show this report. The Plausible alternatives page lists what CE keeps.

Read the Checkout Session, then send the browser event

Stripe replaces {CHECKOUT_SESSION_ID} when it redirects. Set success_url to https://example.com/checkout/success?session_id={CHECKOUT_SESSION_ID}. If the customer stays on Stripe's confirmation page, your site has no page on which to fire the event.

Retrieve the session on the server. Send revenue only when payment_status is paid and amount_total is above zero. Plausible treats a zero amount as a conversion and says it pulls average revenue down. A free trial should be a separate Trial started goal, with no revenue object.

amount_totalis a minor unit. Divide by 100 for USD and EUR. Do not divide JPY. Plausible publishes this helper and points at Stripe's zero-decimal list. It leaves UGX and ISK out of that set because Stripe still sends those two multiplied by 100.

lib/revenue.ts
// Plausible's ecommerce page: amount is the major unit, currency is uppercase ISO 4217.
// Zero-decimal list from that page. It leaves out UGX and ISK on purpose:
// Stripe sends those two as a two-decimal value (x100).
const ZERO_DECIMAL = new Set([
  "BIF", "CLP", "DJF", "GNF", "JPY", "KMF", "KRW",
  "MGA", "PYG", "RWF", "VND", "VUV", "XAF", "XOF", "XPF",
])

export function toMajorAmount(minorAmount: number, currency: string) {
  const code = currency.toUpperCase()
  const amount = ZERO_DECIMAL.has(code) ? minorAmount : minorAmount / 100
  return { amount, currency: code }
}

Skip a session whose createdtime is an hour old or more. Plausible's ecommerce page names that check so a bookmarked thank-you URL does not add the sale again.

app/checkout/success/page.tsx
import Stripe from "stripe"
import { PlausiblePurchase } from "@/components/plausible-purchase"
import { toMajorAmount } from "@/lib/revenue"

export default async function CheckoutSuccessPage({
  searchParams,
}: {
  searchParams: Promise<{ session_id?: string }>
}) {
  const { session_id: sessionId } = await searchParams
  const secretKey = process.env.STRIPE_SECRET_KEY
  if (!sessionId || !secretKey) return <p>Thanks for your order.</p>

  const stripe = new Stripe(secretKey)
  const session = await stripe.checkout.sessions.retrieve(sessionId)
  const ageSeconds = Math.floor(Date.now() / 1000)-session.created
  const paid =
    session.payment_status === "paid" &&
    typeof session.amount_total === "number" &&
    session.amount_total > 0 &&
    Boolean(session.currency) &&
    ageSeconds >= 0 &&
    ageSeconds < 60 * 60

  if (!paid || session.amount_total == null || !session.currency) {
    return <p>Thanks for your order.</p>
  }

  const revenue = toMajorAmount(session.amount_total, session.currency)
  return <PlausiblePurchase amount={revenue.amount} currency={revenue.currency} />
}

The client call matches the JavaScript example on the ecommerce page. props.plan is optional. Plausible says custom properties must not contain an email, a customer id, or an order id. After the call, history.replaceState drops session_id from the URL. A reload then has nothing to send.

components/plausible-purchase.tsx
"use client"

import { useEffect } from "react"

declare global {
  interface Window {
    plausible?: (
      eventName: string,
      options?: {
        revenue?: { currency: string; amount: number | string }
        props?: Record<string, string>
      },
    ) => void
  }
}

export function PlausiblePurchase({ amount, currency }: { amount: number; currency: string }) {
  useEffect(() => {
    window.plausible?.("Purchase", {
      revenue: { currency, amount },
      props: { plan: "pro" },
    })
    window.history.replaceState(null, "", window.location.pathname)
  }, [amount, currency])

  return null
}

Worked numbers, from those docs: amount_total of 4900 and currency eur become amount: 49 and currency: "EUR". An invalid code does not error. Plausible records the event and drops the revenue. Confirm one POST to /api/event with HTTP 202. x-plausible-dropped: 1 means the hit was dropped.

How do you track a Stripe payment in Umami?

Umami's revenue doc, available since v2.14.0, says the event must include revenue and currency. In umami.track(), revenue is a number in the major unit. A data attribute wants that same revenue as a string. This guide uses the function.

Pass the amount you already converted for Plausible. An unrecognized currency code defaults to USD. Event data allows numbers with a maximum precision of 4, strings up to 500 characters, and at most 50 properties. The tracker call includes the default page properties, including the URL and the referrer.

components/umami-purchase.tsx
"use client"

import { useEffect } from "react"

declare global {
  interface Window {
    umami?: {
      track: (eventName: string, data?: Record<string, unknown>) => void
    }
  }
}

export function UmamiPurchase({ amount, currency }: { amount: number; currency: string }) {
  useEffect(() => {
    window.umami?.track("checkout-cart", { revenue: amount, currency })
    window.history.replaceState(null, "", window.location.pathname)
  }, [amount, currency])

  return null
}

Umami Cloud can import Stripe on a Pro or Business plan. The payment-provider page says Umami reads charges and refunds and never creates a charge. Use a restricted key with read access only. Imports run about every hour and recheck the previous 7 days.

Those payments stay unlinked until both sides share an id. Call umami.identify('user-123') and set Stripe metadata umami_distinct_idto that same value. Umami links the payment to the latest visit in the prior 90 days. That id is optional. The cookieless guide on this site quotes Umami's security page, updated 22 October 2026: the standard tracker does not track people across websites. Leave the email out of the event data.

Self-hosted Umami still accepts the track() revenue fields. The Stripe import above is the Cloud integration. The Umami alternatives page records the Cloud plan split, including Hobby at $0 on the 25 November 2026 check.

What amount do Fathom and Simple Analytics accept?

Fathom's ecommerce page says _value is cents. A $10 event is 1000. For a two-decimal currency, Stripe's amount_total is already that unit, so 4900 USD cents stay 4900. That page does not print a zero-decimal exception, so the cents example here is for USD and EUR.

New Fathom events use the site default currency, which stays None until you set it from the Events box. Since 25 October 2023, new goals use trackEvent. trackGoal remains only for goals that already exist.

Simple Analytics has no revenue object on the events page. Metadata is a flat object of text, booleans, numbers, or dates. The metadata page shows a number such as usd: 50.99 on sa_event. You can filter a goal on that field. Event names allow letters, numbers, and the _ character. Names are case-sensitive.

Browser calls after the session is paid
// Fathom's ecommerce page: _value is cents. 1000 means $10.00.
// For USD, Checkout Session amount_total is already the minor unit.
window.fathom?.trackEvent("purchase", { _value: 4900 })

// Simple Analytics metadata is a flat object. Numbers are allowed.
// Event names keep letters, numbers, and the _ character. Names are case-sensitive.
window.sa_event?.("purchase", { usd: 49 })

The alternatives page, from Simple Analytics pages read 27 November 2026, says the Free plan excludes events and that Simple starts at $15/month. A Free site will not show purchase.

Simple Analytics also accepts a server POST. The server-side page sends JSON to https://queue.simpleanalyticscdn.com/events. The user agent must not be node-fetch, axios, curl, or python-requests. A value that contains bot, spider, crawl, or agent is marked as a robot too. Their example uses a custom token such as ServerSide/1.0.

Simple Analytics server event
// Simple Analytics server events: POST JSON to this URL.
// Use a custom User-Agent. Their page marks python-requests, curl, node-fetch,
// and axios as robots, and also marks a user agent that contains bot, spider, crawl, or agent.
await fetch("https://queue.simpleanalyticscdn.com/events", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    type: "event",
    hostname: "example.com",
    event: "purchase",
    path: "/checkout/success",
    ua: "CheckoutWebhook/1.0 (+https://example.com/)",
    metadata: { usd: 49 },
  }),
})

How do you post the goal from the success-page request?

Use this path when an ad blocker never loads the script. window.plausible is then undefined, and the browser call sends nothing. The install guide shows a first-party rewrite that can dodge some blockers. A blocked script still leaves no visit to join.

Plausible's Events API joins an existing visit only when four things are true. The POST carries that visitor's User-Agent. It carries that visitor's IP in X-Forwarded-For. The urlis on the same site. The event arrives within 30 minutes of the visitor's last event.

The documented place to do that is the request that renders the thank-you page. The browser is the client of that request, so the route can forward its headers. Do not copy the request Referer into referrer. If no visit matches, the payment host would become the source.

Call this function instead of rendering PlausiblePurchase. Both together count the sale twice. If no visit matches, Plausible still counts the revenue and credits Direct / None. A data-center IP in X-Forwarded-For can drop the event. HTTP 202 is not proof it was stored. Read x-plausible-dropped.

lib/send-plausible-purchase.ts
import { headers } from "next/headers"

// Call this from the success page instead of the browser component.
// Plausible joins the visit only when User-Agent, IP, site, and the 30 minute window match.
export async function sendPlausiblePurchase(input: {
  domain: string
  amount: number
  currency: string
}) {
  const headerList = await headers()
  const forwardedFor = headerList.get("x-forwarded-for")?.split(",")[0]?.trim() ?? ""

  const response = await fetch("https://plausible.io/api/event", {
    method: "POST",
    headers: {
      "User-Agent": headerList.get("user-agent") ?? "",
      "X-Forwarded-For": forwardedFor,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      name: "Purchase",
      url: `https://${input.domain}/checkout/success`,
      domain: input.domain,
      revenue: { currency: input.currency, amount: input.amount },
      props: { plan: "pro" },
    }),
  })

  return {
    status: response.status,
    dropped: response.headers.get("x-plausible-dropped"),
  }
}

Plausible uses the first valid IP in X-Forwarded-For. A CF-Connecting-IP header wins when it is present. A test POST with X-Debug-Request: true returns that IP and is not recorded.

Should a Stripe webhook send the analytics event?

Stripe's fulfillment guide says you cannot rely on the success page. A customer can pay and lose the connection before your page loads. Subscriptions and delayed methods also change state after Checkout completes. Listen for checkout.session.completed and checkout.session.async_payment_succeeded.

That webhook fulfills the order. It carries no visitor User-Agent or IP. Plausible's Events API page says payment-provider webhooks are not suitable. They run on a server, often later, with no visitor headers. The event cannot join the visit that led to the payment. It can add a Direct / None visitor, or bot filtering can drop a data-center IP. The API still returns HTTP 202.

Plausible also says not to send renewals or refunds from webhooks. Those rows would not match a visit. Keep them in Stripe. The route below still shows the POST, so you can see the payload, and so you can confirm the drop header. Do not treat its total as campaign revenue.

app/api/stripe/webhook/route.ts
import { NextResponse } from "next/server"
import Stripe from "stripe"
import { toMajorAmount } from "@/lib/revenue"

export const runtime = "nodejs"

// This POST does not join the browser visit. Plausible's Events API page says
// payment-provider webhooks are not suitable for attribution. Use it to record
// that Stripe charged the card. Keep the success-page event for the campaign.

export async function POST(request: Request) {
  const secretKey = process.env.STRIPE_SECRET_KEY
  const webhookSecret = process.env.STRIPE_WEBHOOK_SECRET
  const domain = process.env.PLAUSIBLE_DOMAIN
  if (!secretKey || !webhookSecret || !domain) {
    return NextResponse.json({ error: "Stripe webhook is not configured" }, { status: 500 })
  }

  const stripe = new Stripe(secretKey)
  const payload = await request.text()
  const signature = request.headers.get("stripe-signature")
  if (!signature) {
    return NextResponse.json({ error: "Missing Stripe-Signature" }, { status: 400 })
  }

  let event: Stripe.Event
  try {
    event = stripe.webhooks.constructEvent(payload, signature, webhookSecret)
  } catch {
    return NextResponse.json({ error: "Invalid signature" }, { status: 400 })
  }

  if (
    event.type !== "checkout.session.completed" &&
    event.type !== "checkout.session.async_payment_succeeded"
  ) {
    return NextResponse.json({ received: true })
  }

  const session = event.data.object
  if (session.object !== "checkout.session") {
    return NextResponse.json({ received: true })
  }
  if (session.payment_status !== "paid" || !session.amount_total || !session.currency) {
    return NextResponse.json({ received: true, skipped: true })
  }

  // Store event.id before the POST. Stripe retries this delivery.
  // The sync guide shows onConflictDoNothing. A duplicate must return 200
  // and must not send Purchase again.

  const revenue = toMajorAmount(session.amount_total, session.currency)
  const response = await fetch("https://plausible.io/api/event", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "User-Agent": "CheckoutWebhook/1.0 (+https://example.com/)",
    },
    body: JSON.stringify({
      name: "Purchase",
      url: `https://${domain}/checkout/success`,
      domain,
      revenue: { currency: revenue.currency, amount: String(revenue.amount) },
    }),
  })

  return NextResponse.json({
    received: true,
    plausibleStatus: response.status,
    dropped: response.headers.get("x-plausible-dropped"),
  })
}

Read the body with request.text() and pass that string to stripe.webhooks.constructEvent. Parsing JSON first changes the bytes, and the signature check fails. Run the route on the Node.js runtime. The webhook versus polling guide shows the event-id insert. Store event.id before the POST. Stripe retries the delivery. A second delivery must return 200 and must not send Purchase again.

Delayed methods such as a bank debit can complete with payment_status still unpaid. The success page in Plausible's Stripe example does not count those. checkout.session.async_payment_succeeded fires when the funds later clear. By then the visit is over. The route above skips any session that is not paid or has no positive total.

Stripe waits up to 10 seconds for a non-organization checkout.session.completed endpoint, then redirects. Return 200 after the event id is stored. Send the campaign goal from the success page.

What will this revenue goal never show?

Plausible describes the goal as the value of purchases completed during a visit, credited to that visit's source, campaign, and pages. It does not link a person across visits or devices. A pricing page on a phone and a payment on a laptop are two visits. The phone campaign does not receive the revenue.

These payments stay out of the visit, for the reasons on Plausible's ecommerce page:

  • Subscription renewals and later upgrades happen in Stripe, not in the browser.
  • Refunds and chargebacks happen days later. The original Purchase total stays put.
  • A checkout that sits longer than 30 minutes starts a new visit on the way back.
  • A payment link opened from email has no earlier pageview unless it returns to your site.
  • A blocked script means the server POST, if you send one, is Direct / None.

Umami's default tracker does not close those gaps. The Cloud import can attach a payment to a Distinct ID for 90 days, and it does import refunds. You opted into an id to get that link. Without the id, the imported charge is website revenue with no referrer.

None of these goals are MRR. MRR is active subscriptions normalized to one month. A single Checkout total is one charge. It mixes a one-time payment with the first invoice of a subscription. It ignores a renewal that never hit the success page. The guide to calculating MRR from the Stripe API lists subscriptions, applies quantity and interval, and handles coupons. Stripe does not return an MRR field.

When do you need a Stripe metrics dashboard?

Stay with Plausible or Umami when the question is which campaign brought the first payment. Move to Stripe data when the question is the current book: MRR, churn, or LTV.

Data Lighthouse is a Next.js template for that second report. You host it. The license is $59 once. Optional Stripe cards show revenue for 7, 14, or 30 days from succeeded charges. Refunds are not subtracted. MRR counts subscriptions with status active, normalized to one month. ARR is that MRR times 12. Revenue per visitor uses distinct visitors in Postgres for the same window.

The overview does not compute churn. The tracker stores a visitor id in localStorage. That is a different privacy choice than a cookieless script, and the template does not import Plausible or Umami history. The Next.js Stripe analytics dashboard page lists the cards and the STRIPE_SECRET_KEY setup.

The live demo renders sample data. It does not call Stripe. Pricing is the license page. Checkout is $59 once, with GitHub sign-in before Polar payment.

7-day no-questions refund. If the template is not a fit, request it within 7 days through the purchase contact on the contact page.

Stripe revenue questions

Short answers for the success page, the webhook, and the point where a goal stops being MRR.

How do I track Stripe revenue in Plausible?

Add a custom event goal named Purchase and turn on revenue tracking. Plausible's ecommerce page says this is a Business plan feature. On the Next.js success page, retrieve the Checkout Session and call plausible('Purchase', { revenue: { currency, amount } }). Amount is the major unit, so 4900 USD cents become 49. Currency must be uppercase. The goal name is case-sensitive. Community Edition leaves ecommerce revenue goals on Cloud.

How do I track a Stripe conversion in Umami?

Call umami.track('checkout-cart', { revenue: 49, currency: 'USD' }) after you have confirmed the Checkout Session is paid. The revenue doc, available since v2.14.0, requires those two data properties. Revenue in the tracker call is a number in the major unit. An unrecognized currency code defaults to USD. Umami Cloud can also import Stripe payments on a Pro or Business plan. That import is separate from track().

Should the Stripe webhook send the analytics event?

Use the webhook for fulfillment. Stripe's fulfillment guide says a customer can pay and never reach your success page. Plausible's Events API page says a payment-provider webhook is not suitable for attribution: it has no visitor User-Agent or IP, so it cannot join the visit. The POST can start a Direct / None visit, or Plausible can drop it when the IP is a data center. The API still returns HTTP 202. Check the x-plausible-dropped response header.

Why is cookieless revenue lower than the Stripe balance?

Plausible counts purchases completed during a visit, and it does not store a persistent id. A renewal, a refund, a charge on another device, and a checkout that lasts more than 30 minutes do not keep the original campaign. Visitors who block the script have no visit to join. Plausible's ecommerce page says to expect this revenue to be lower than Stripe.

Do refunds and MRR show up in a Plausible or Umami goal?

A browser Purchase event does not subtract a later refund and does not compute MRR. Plausible says renewals and refunds happen in the billing system, and it says not to send them from webhooks. Umami Cloud's payment-provider import does pull payments and refunds about every hour on a Pro or Business plan. That report is still not a subscription MRR formula.

When should I use a Stripe metrics dashboard instead?

Use Stripe data when you need MRR, churn, or LTV. A pageview goal cannot list active subscriptions. Data Lighthouse is a Next.js template you host. The license is $59 once. Optional Stripe cards show succeeded-charge revenue, MRR from active subscriptions, ARR as that MRR times 12, and revenue per visitor. Refunds are not subtracted. The overview does not compute churn. The sample dashboard is at https://datalighthouse.dev/demo and pricing is at https://datalighthouse.dev/pricing.

Sources