See which post, launch or link sold your downloads on Stripe.
For creators who sell downloads, templates and ebooks through Stripe Checkout or Payment Links. Virling ties each payment to the channel and campaign that brought the buyer, so you see which post, newsletter or creator sold the product, not only which one sent visitors. Open source under AGPL, hosted or self-hosted.
A launch post, a newsletter mention or a link in a video sends a wave of visitors to your sales page, and a few of them buy. Stripe records who paid, but not the visit that brought them. Virling joins the two through the visitor ID that checkout carries, and reads Stripe with a restricted key that cannot write.
What you get
- Each sale credited to a channel and campaign. A payment is joined to the visits before it. By default it goes to the latest visit in the last 90 days that was not Direct, so a buyer who found you through a post and came back later by typing your URL is still credited to the post.
- Posts and links compared by revenue. In the Channels card, the Source tab splits a channel by source, such as Reddit or a newsletter, and the Campaign tab shows each tracked link. Compare revenue per visitor to see which post brought buyers rather than only traffic.
- Launch days measured in sales. Log a launch under Launches to see the visitors, new customers and revenue of that day and the day after.
- Creators and affiliates ranked by revenue. Under Partners, each creator or affiliate link shows its visitors, paying customers and refund rate. Copy report link gives the partner a read-only page with only their own numbers. Virling does not pay partners.
- The visits behind every sale. Open a payment to see the visits before it and which one got the credit.
- Refunds and disputes taken off. Stripe events for refunds, lost disputes and late settlements update payments that were already imported.
See which post sold your product
For creators who sell downloads, templates and ebooks through Stripe. Virling is open source under AGPL: self-host it free, or use the hosted version with a 14-day free trial.
Set it up
- Install the script. Add your site, then paste the tag before
</head>on every page of your site or sales page. It sets thevirling_vidcookie, the visitor ID that checkout will carry. Leave cookieless mode off. - Connect Stripe. Create a restricted key with Read on Charges, Checkout Sessions, Customers, Events, Invoices, Subscriptions and PaymentIntents, and paste it under Setup, then Connect payments. Secret keys are refused. The last 90 days are imported, then new payments are checked every minute.
- Link your buy button. A Payment Link on
buy.stripe.comneeds no code: keep it as a normal<a href>on a page that runs the script, and the script adds the visitor ID when a visitor clicks. For a Checkout Session you create on your server, setclient_reference_id, ormetadata.virling_vidif you already use that field. - Tag launch and social links. Visits from a bio link, an app or a newsletter often arrive with no referrer and land in Direct. Make one tracked link per place you post, and point it at your sales page, not straight at checkout.
- Make a test purchase. With a test mode key and Payment Link, open your site in a private window from a link tagged
?utm_source=test&utm_medium=testand buy. Wait a minute, and the payment should show thetestsource instead of Unattributed.
<!-- A Payment Link: no code needed -->
<a href="https://buy.stripe.com/...">Buy the template</a>
// A Checkout Session you create on your server
await stripe.checkout.sessions.create({
mode: "payment",
line_items: [{ price: "price_...", quantity: 1 }],
client_reference_id: req.cookies.virling_vid,
// ...
});Payment Links are covered step by step in Stripe Payment Link UTM tracking. If you hand creators a code as well as a link, discount code attribution shows how to check one against the other. Every setting is on the Stripe integration page, and other payment providers are on revenue attribution for digital products.
From link to sale: what can be linked
| What you do | Can the sale be linked? | Why, or what it takes |
|---|---|---|
| Share your sales page in a post | Yes | The visit is recorded, and the visitor ID goes along when the buyer clicks through to checkout |
| Share a Payment Link in a post, a bio or a QR code | Not by visitor ID | The link opens without your page, so no client_ is added |
| Email a link to your sales page | Yes | Add utm_medium=email so the visit counts as Email |
| Email a Payment Link | Not by visitor ID | It carries none. An email match is possible, as described below |
| Put a Payment Link on your own site | Yes | A normal <a href> to buy.stripe.com on a page that runs the script. A Payment Link on a custom domain is left alone |
| Create a Checkout Session on your server | Yes, if you pass the ID | client_, or metadata. |
| Take the card on your own page with Elements | Yes, if you pass the ID | metadata. on the PaymentIntent |
| Sell through a marketplace listing | Only if the listing leads to your site and the buyer pays through your own checkout | A sale the marketplace bills itself does not pass through your checkout, so it carries no visitor ID |
Stripe payments with no visitor ID can still be matched by email. If your site sent the buyer's email to Virling in an identify event, a payment synced after that with exactly the same billing or receipt email is credited to that visitor. See Unattributed revenue. A later payment by the same Stripe customer keeps the channel of the first one, if that was credited. The rest count toward revenue as Unattributed.
A made-up example: more sales, less money
These numbers are invented to show the arithmetic. A seller takes payments on Stripe for a $15 template and a $60 bundle, with no refunds in the period:
| Made up | Visitors | Sales | Revenue | Revenue per visitor |
|---|---|---|---|---|
| Social | 1,200 | 20 | $300 | $0.25 |
| Organic search | 900 | 15 | $450 | $0.50 |
| Referral | 240 | 6 | $360 | $1.50 |
Social made the most sales and the least money, because all 20 were the template. Organic search sold 10 templates and 5 bundles. Referral, a review on another site, sold 6 bundles to 240 visitors, so one of its visitors was worth six times one from Social. Counting sales would have put Referral last; revenue per visitor puts it first. Virling does not read which product a charge was for, so the split between template and bundle comes from Stripe, not from the dashboard.
What to know
- A Payment Link opened from an email, a QR code or another site carries no visitor ID, and its payment shows as Unattributed. It still counts toward revenue.
- If a Payment Link already has a
client_reference_id, the script leaves it alone, so that sale carries no visitor ID. - Payments from the 90-day import were made before the script was on your site, so they are Unattributed. Channel numbers fill in as new sales arrive.
- Virling does not read which product a charge was for. If you sell several products on one site, give each its own tracked links.
- Virling does not read discount codes. Redemptions stay in Stripe.
Open source
Virling is open source under AGPLv3, and the code is on GitHub. Use the hosted service, or self-host it as one binary with every feature. In a load test on 2026-10-31, in a container limited to one vCPU and 1 GB of RAM, it ingested 100,000 pageviews at 2,829 a second with none failed and a p99 of 34 ms, and used 157 MB of memory after the ingest.
Frequently asked questions
Which post sold my ebook or template on Stripe?
Add the Virling script to your sales page and connect Stripe with a restricted, read-only key. The script adds the visitor ID to normal Payment Links on buy.stripe.com, and each sale is credited to the visits before it. The Source tab splits each channel by source, and the Campaign tab shows each tracked link.
Do I need code to track Stripe Payment Links?
No. When a visitor clicks a normal link to buy.stripe.com on a page that runs the script, the script adds client_reference_id with the visitor ID, unless the link already has one. Only a Checkout Session or PaymentIntent you create on your server needs the visitor ID set in code.
Can I link straight to a Stripe Payment Link from a newsletter or bio?
You can, but that sale shows as Unattributed. A Payment Link opened from an email, a QR code or another site carries no visitor ID. Point the link at your sales page and let buyers click through to checkout from there.
Does Virling track Stripe discount codes?
No. Virling credits each payment to the visits before it and does not read discount codes, so redemptions stay in Stripe. Give each creator a tracked link as well as a code, and compare the two.
Are Stripe refunds and disputes taken off?
Yes. Virling reads Stripe events for refunds and closed disputes, so refunds and lost disputes update payments that were already imported.
Can a Stripe sale be credited without a visitor ID?
Yes, if the email matches. When your site has sent the email of the buyer to Virling in an identify event, a Stripe payment synced after that, with no visitor ID and the same billing or receipt email, is credited to that visitor and shows Matched by email.
Full guides: Sell digital products, Stripe in the docs and Tracked links.