Source: https://usedataowl.com/docs/stripe-payment-links
Markdown source: https://usedataowl.com/docs/stripe-payment-links.md
Description: Track which traffic sources, tweets, and landing pages generate sales through Stripe Payment Links using a simple post-checkout redirect URL.

# No-Code Revenue Attribution for Stripe Payment Links

> Make sure you've [connected your Stripe account](/docs/connect-payment-provider) first.

**Nothing to do.** The script adds the visit to every Stripe payment link on your pages (as `client_reference_id`) as soon as the link appears, and Stripe sends it back with the payment. It works even when the buyer pays on another device or never comes back to your site.

## Optional backup: the success page

In [Stripe Payment Links](https://dashboard.stripe.com/payment-links), select a link and open **After payment**. Under **Confirmation page**, redirect customers to your website and add `?session_id={CHECKOUT_SESSION_ID}` to the URL:

```text
https://example.com/thanks?session_id={CHECKOUT_SESSION_ID}
```

When the buyer lands there, the script reports `session_id` and DataOwl ties that payment to the visit, whether the webhook arrived before or after.

## Important notes

- Reloads and repeat redirects are fine: it's the same payment, recorded once.
- If you set `client_reference_id` yourself, the script leaves it alone; add the [success page](#optional-backup-the-success-page) or [metadata](/docs/stripe-checkout-api) instead.
