Guide
How to track Stripe revenue by marketing channel
Updated October 14, 2026
In short
Pass the visitor ID into Stripe Checkout metadata, add a webhook for checkout.session.completed, and each payment is credited to the channel that brought the customer.
1. Pass the visitor ID to your server
On the page that starts checkout, read window.vast.visitorId and send it to your server with the checkout request.
2. Add it to the Checkout Session metadata
Create the session with metadata vast_visitor_id set to the value from step 1. For subscriptions, set it on subscription_data.metadata too so renewals are attributed.
3. Connect Stripe in Settings
In Visitor Fast, open Settings → Revenue and choose Stripe. With "Set it up for me", paste a restricted API key with read access to Checkout Sessions, PaymentIntents, Invoices and Refunds and write access to Webhook Endpoints; Visitor Fast creates the webhook and keeps its signing secret. Or choose "I'll add the webhook", add the private URL in Stripe for checkout.session.completed, invoice.paid and refund events, and paste its signing secret. Every signature is verified before anything is stored.
4. Check the result
Complete a test purchase. The payment appears on the Overview and Sources pages with the visitor's source and campaign.