With Stripe Elements (opens in a new tab) the checkout lives on your own page: your server creates a PaymentIntent and the browser or app confirms it. Reveata follows the PaymentIntent, so that is where the visitor id goes.
What you get
- One-off payments from Elements, the Payment Element, Express Checkout and Stripe's iOS, Android and React Native SDKs, credited to their visit.
- Refunds and lost disputes booked against the original payment, as negative revenue on the day they happen, with the same source.
- The buyer's email from the receipt email, the customer or the billing details, used as a fallback match.
How to pass the ids
- Connect Stripe (Stripe revenue analytics).
- Send
window.reveata.metadata()from the page to the endpoint that creates the PaymentIntent, or read the_dt_vand_dt_scookies on the server. - Store them as metadata:
const intent = await stripe.paymentIntents.create({
amount: 4900,
currency: 'usd',
metadata: {
reveata_visitor_id: body.reveata_visitor_id,
reveata_session_id: body.reveata_session_id,
},
});reveata_user_id, the id you pass to identify, works as a third key.
Mobile apps
A React Native or Expo app with the Reveata SDK has its own visitor id: send Reveata.metadata() to your server and put it in the PaymentIntent metadata, as on the web. Apps without the SDK can still be linked by identifying the buyer with the same user id or email on your website, or by opening a web checkout page that runs the script.
How Reveata counts PaymentIntents
| Case | How it is counted |
|---|---|
| A succeeded PaymentIntent | One payment, under its pi_… id |
| A PaymentIntent that pays an invoice | Counted once, through the invoice |
| Webhook and scheduled import of the same intent | Stored once per Stripe id |
For subscriptions, put the ids on the first payment through Stripe Checkout or in the subscription's metadata, because the invoice is what counts.