Stripe Checkout (opens in a new tab) is the hosted payment page your server opens with a Checkout Session. Because your server creates the session, it is also the best place to say which visitor is paying. Two metadata keys are enough.
What you get
- Each Checkout payment credited to the visit that led to it, under your attribution model (first touch, last touch or last non-direct touch).
- In
subscriptionmode, the ids are applied to the first invoice and to the subscription, so every renewal keeps the source of the first payment. You only send the ids once. - In
paymentmode, they are applied to the PaymentIntent the session creates. - Revenue, customers and revenue per visitor on every report, from channels to landing pages.
The keys Reveata reads
| Where on the session | Keys |
|---|---|
metadata |
reveata_visitor_id, reveata_session_id, optional reveata_user_id |
client_reference_id |
dt_<visitorId>_<sessionId> |
Reveata reads these when the checkout.session.completed or checkout.session.async_payment_succeeded webhook arrives, and also during scheduled imports. Stripe's own notes on metadata are in Stripe's metadata documentation (opens in a new tab).
How to set it up
- Connect Stripe in Settings → Payments with a restricted key or Connect with Stripe (Stripe revenue analytics).
- Get the ids. In the browser,
window.reveata.metadata()returns{ reveata_visitor_id, reveata_session_id }. On your server, read the first-party cookies_dt_vand_dt_sand keep the part before the first dot. - Put them in the session's
metadatawhen you create it:
const session = await stripe.checkout.sessions.create({
mode: 'subscription',
line_items: [{ price: priceId, quantity: 1 }],
success_url: 'https://example.com/thanks',
metadata: {
reveata_visitor_id: body.reveata_visitor_id,
reveata_session_id: body.reveata_session_id,
},
});The Stripe Checkout guide has the cookie parser for Node.js, PHP, Python, Ruby and Go, and a Next.js helper (readTrackerIds from @reveata/next/server).
Limits worth knowing
- Cookieless mode keeps no ids in the browser, so there is nothing to send. Payments then match by the buyer's email for visitors you identify.
- The session cookie expires after 30 idle minutes. The visitor id alone is enough to match.
- A free, fully discounted checkout is not a payment and does not appear.
- Unmatched payments are retried every hour for 90 days, so an identify call after the purchase still links them.