Stripe
Connect Stripe revenue to Talivia sessions and sources.
Stripe is the recommended revenue path when your checkout runs through Stripe Checkout, Payment Links, invoices, or subscriptions.
Connect Stripe
Open Website settings -> Revenue, choose Stripe, create a restricted API key from the link in Talivia, and paste it into the Stripe key field.
Talivia uses that key to:
- create the Stripe webhook endpoint for the current website;
- import recent completed checkout sessions;
- keep future payments, subscriptions, refunds, and disputes synced;
- attribute payments back to sessions, sources, pages, campaigns, and keywords.
Use a restricted Stripe key. Do not paste your full secret key. The setup screen links to a Stripe key form with the required read and webhook permissions preselected.
Pass session context
For the best match rate, read Talivia session data before redirecting the visitor to checkout.
const talivia = window.talivia?.getSession?.();
await fetch('/api/create-checkout', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ talivia }),
});On your server, attach those values to Stripe Checkout metadata.
await stripe.checkout.sessions.create({
mode: 'payment',
success_url: 'https://your-site.com/thanks?session_id={CHECKOUT_SESSION_ID}',
metadata: {
talivia_visitor_key: talivia?.visitorKey,
talivia_session_key: talivia?.sessionKey,
talivia_session_id: talivia?.sessionId,
},
client_reference_id: talivia?.visitorKey,
});Return URL
If you use Stripe Checkout, keep the checkout session id in the success URL.
https://your-site.com/thanks?session_id={CHECKOUT_SESSION_ID}Talivia can use the return visit plus Stripe webhook data to recover attribution when metadata is incomplete.
Verify
- Make a test Stripe payment.
- Open Talivia and go to the website dashboard.
- Check the payment list and the session detail.
- Confirm the payment has a source, entry page, session, and activity timeline.