Supported Stripe methods
- Stripe Checkout - Hosted checkout pages
- PaymentIntent API - Custom payment flows
- Payment Links - Shareable payment links
- Other Stripe methods - Any Stripe payment method
Setup
Step 1: Get your webhook URL
Your webhook URL is:Step 2: Configure Stripe webhook
- Go to your Stripe Dashboard
- Click “Add endpoint”
- Enter your webhook URL:
https://your-domain.com/api/webhooks/stripe - Select events to listen for:
checkout.session.completedpayment_intent.succeededcharge.refunded
- Copy the Signing secret (you’ll need this for verification)
Step 3: Add webhook secret to environment
Add your Stripe webhook secret to your environment variables:Stripe Checkout
Include visitor/session IDs in metadata
When creating a checkout session, include visitor and session IDs in the metadata:Redirect to checkout
PaymentIntent API
Include visitor/session IDs in metadata
Payment Links
For Payment Links, you can’t add metadata directly. Instead, use the customer email matching method:- Enable user identification in PostMetric
- Identify users before they purchase
- Payments will be linked via email matching
View revenue data
Once payments are linked, you can view:- Revenue by source/channel
- Revenue by campaign
- Conversion rates
- Average order value
Refunds
Refunds are automatically tracked when acharge.refunded event is received. The payment status will be updated to “refunded” in your dashboard.
Troubleshooting
Payments not appearing
- Check that the webhook is configured correctly
- Verify the
websiteIdis included in payment metadata - Check webhook logs in Stripe Dashboard
- Verify the webhook secret is set correctly
Payments not linked to visitors
- Ensure visitor/session IDs are included in payment metadata
- Enable user identification for email matching fallback
- Check that the visitor was tracked before the payment
Next steps
Revenue attribution guide
Learn more about revenue attribution