Skip to content
Payment providers

Stripe Payment Links analytics without code

2 min read · Updated · By the Reveata team

Short answerThe 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.

Payment Links (opens in a new tab) are the fastest way to sell with Stripe: a buy.stripe.com address, no server. That is also why most analytics tools lose track of them. Reveata handles them in the browser instead.

What the script adds

On your page What the script does
A link to https://buy.stripe.com/… Adds client_reference_id=dt_<visitorId>_<sessionId> when the link is clicked, middle clicks included
<stripe-buy-button> Sets its client-reference-id attribute
<stripe-pricing-table> Sets its client-reference-id attribute

Stripe copies the reference onto the Checkout Session it creates. When the payment arrives, Reveata recognises the dt_ format and credits the payment to that visit. A reference you set yourself is never overwritten, and one in another format is ignored.

Setting it up

  1. Install the Reveata script on the pages that show your links.
  2. Connect Stripe in Settings → Payments (Stripe revenue analytics).
  3. That is all. There is no metadata to add and no server code.

This is why Payment Links suit site builders: on Webflow, Framer, Carrd or a plain HTML page you get attributed revenue with nothing but the snippet.

When the id cannot be added

  • A link opened outside your site. A Payment Link in an email, a social bio, a QR code or a chat goes straight to Stripe and carries no visitor id.
  • A redirect in JavaScript, such as window.location = 'https://buy.stripe.com/…'. The script decorates clicked links, not addresses set in code. Append the reference yourself with reveata.visitorId() and reveata.sessionId().
  • Cookieless mode. The cookieless script has no ids to add.

The payment still counts in revenue in all three cases. Reveata then tries the buyer's email against visitors you identified, and retries every hour for 90 days. You can also point the link's after-payment redirect at your own page with ?session_id={CHECKOUT_SESSION_ID}, and Reveata links the payment when the buyer lands there (thank-you page payments).

Instead of sharing the raw Payment Link, share a page of your site with a tag such as ?ref=newsletter, and let the button on that page send people to Stripe. The visit gets the source, and the payment follows the visit.

Frequently asked questions

Do Buy Buttons added later by a single-page app get the id?

Yes. Buttons and tables added after the page loads receive the attribute on the next page view of your app.

How can I check it works?

Open the page in a private window from a link ending in ?ref=test, click the Payment Link and look at the Stripe address: it ends with client_reference_id=dt_…. After a test or small refunded purchase, the payment appears under Revenue with the source test.

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?
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.IntegrationWebflow analytics with revenue attributionPaste the Reveata snippet into Webflow's site-wide Head code and publish. Every page is counted, and sales from the checkouts your pages link to are credited to the visits that brought the buyer.IntegrationFramer analytics with sales credited to visitsAdd the Reveata snippet in Framer's Custom Code settings at the end of the head, on all pages, and publish. The script follows Framer's page changes, and sales from the checkouts your buttons link to are credited to their visits.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.IntegrationPolar analytics with revenue attributionReveata 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.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.