virling Pricing Self-host Demo Changelog Agencies GitHub Start free trial
integrations / online courses

Revenue attribution for online courses

Course buyers find you on YouTube, in a newsletter, at a webinar, through an affiliate or on social, and often enroll weeks after their first visit. Virling joins each course or cohort sale to the visits before it, so you see which video, issue, webinar or partner brought the money, not just the clicks. Works with Stripe, LemonSqueezy, Polar, Creem and Shopify.

Start free trial See the demo

A course sale rarely follows one click. Someone watches a video, joins your list, sits in on a free webinar, and buys when the cart opens. Virling carries a visitor ID from that first visit into checkout and credits the enrollment to one of the visits before it; How Virling works has the details.

The questions it answers

  • Which video or post sold the course? Revenue per YouTube video, newsletter issue, webinar or social post, from the campaign on its link.
  • Which affiliate was worth it? Revenue, paying customers and refund rate per partner, not clicks.
  • Which launch email filled the cohort? The open-cart, reminder and last-call emails, each as its own row.
  • Did the free lessons pay off? Revenue by landing page shows whether buyers who first arrived on a free lesson or the webinar signup page went on to enroll.

Free lessons and webinars before the sale

Most course buyers sample first: a free mini-course, a few YouTube lessons, a live webinar or its replay. Those pages are where the first visit happens, weeks before the payment, so they belong in your tags. YouTube counts as Social, and a link tagged utm_medium=email as Email, but links opened in the YouTube app or an email client often arrive with no referrer at all.

Tag the links in video descriptions, lesson emails and webinar follow-ups with one utm_campaign per video, lesson or webinar, or hand out a tracked link that builds the tags in. The landing page report then shows how much revenue came from buyers who started on the free lesson page, and the Campaign tab which webinar they came from. YouTube revenue tracking and webinar revenue tracking walk through the tags.

See which video or email sold your course

For course creators who sell online. Virling is open source under AGPL: self-host it free, or use the hosted version with a 14-day free trial.

Start free trial See the demo

Launch windows and cart-close deadlines

A launch opens the cart for a set window, such as a week, and sales tend to bunch on the first day and in the last hours before the cart closes. Give each launch email its own utm_campaign, such as launch-2026-03-open and launch-2026-03-last-call, and the Campaign tab shows the visitors and revenue each one brought. Pick the launch dates under Custom range to see that window on its own.

A made-up example, to show how to read one launch. A $400 cohort course, every buyer paying in full, over a seven-day cart:

CampaignVisitorsSalesRevenueRevenue per visitor
Open-cart email90010$4,000$4.44
Webinar replay2508$3,200$12.80
YouTube launch video2,0003$1,200$0.60
Last-call email60015$6,000$10.00

The last-call email closed the most sales and the webinar replay earned the most per visitor, while the video sent the most visitors and sold the least. That reading depends on the model. The default, last non-direct, credits the latest session in the window that was not Direct. A buyer who found you on YouTube, clicked your last-call email and then paid is credited to the email, which tells you which touch closed the sale. First touch credits the earliest session in the window, the video, which tells you which channel brings buyers in. Last touch credits the visit right before the payment, Direct included. Saving the setting rebuilds attribution for every payment, history included, so you can look at one launch both ways and switch back.

Cohort or evergreen

A cohort course sells in launches, so set one launch window against the last with Compare to other dates. An evergreen course sells every day, usually from a webinar or an email sequence that runs on its own, so there is no window to pick: look at a full month and compare channels and landing pages instead, since a single campaign rarely carries the result. If you run both, give each its own sales page, and the page seen before paying keeps their sales apart.

Payment plans

A $600 course sold as three payments of $200 shows $200 in the launch month and $200 in each of the next two, because each instalment counts as revenue on the day it is paid. The second and third payments copy the channel of the first, as long as the provider ties them to the same customer, so the plan stays with the email that sold it; see Renewals. A launch where many buyers chose the plan looks smaller in its own month than it will end up.

Only sessions that started inside the lookback window before the payment are considered. Choose 30, 60, 90 or 365 days; the default is 90. If people follow you for months before a launch, a longer window keeps their first visit in reach. See how long a visitor takes to become a customer.

Affiliates and discount codes

Give each affiliate a link with their own value in utm_source, or ref when utm_source is missing, and the same value in utm_campaign. A partner name is not a known source, so with no referrer the visit counts as Referral, and the Campaign tab shows each partner's visitors and revenue. Or add the partner under Partners in Virling: it makes a short link for them and ranks partners by revenue, with paying customers and refund rate, and Copy report link gives each partner a read-only page with only their own numbers.

Virling credits a sale by the visit before it, not by a discount code, and does not read codes, so code redemptions stay in your payment provider's reports. A code counts only buyers who type it, and a code that leaks to a coupon site credits sales its owner did not drive. Give each affiliate a tagged link as well as a code, and compare the two. Virling does not pay partners or calculate commissions; keep your payout software for that. See affiliate revenue tracking.

Connect your payment provider

  • Stripe: Payment Links need no code, since the script adds the visitor ID on click. For a Checkout Session you create on your server, pass the virling_vid cookie as client_reference_id. Step by step: Stripe course sales by traffic source.
  • LemonSqueezy: connect with an API key and send the visitor ID in the checkout's custom data; the webhook Virling adds to each store to read it needs your server on public https.
  • Polar: connect with an organization token. Checkout links need no code beyond a custom field with the slug virling_vid; checkout sessions take it in metadata.
  • Creem: a scoped API key and the visitor ID in checkout metadata. Virling adds one checkout.completed webhook to read it.
  • Shopify: an Admin API token that can only read orders, and a few lines in your theme that store the visitor ID on the cart.

A student who asks for a refund inside your guarantee period takes that sale off the campaign that brought them. Memberships billed as subscriptions keep the channel of the first payment on every renewal; see Virling for SaaS. If you sell one-to-one sessions or packages next to the course, tracking which channels bring coaching clients covers those, and Stripe for coaches and consultants covers deposits and retainers billed on Stripe.

What to know

  • If someone watches a video on their phone and enrolls later on a laptop, the two browsers are separate visitors.
  • A launch email that links straight to checkout skips your site, so the enrollment has no visit to credit. Link the email to the sales page instead. Unattributed revenue lists the other causes.
  • Someone who followed you for a year before enrolling may have a first visit older than the lookback window; the 365-day window keeps it in reach.

Self-host or hosted

Virling is AGPLv3 software with its source on GitHub: host it yourself, or use ours.

Frequently asked questions

Which checkouts can sell a course?

Stripe, LemonSqueezy, Polar, Creem and Shopify, among others. Connect the one your sales page uses and send the visitor ID with each enrollment. Stripe Payment Links and Polar checkout links get it from the script on click, so a Buy button on your course page is enough.

How do I see which YouTube video or newsletter sold a course?

Tag each link with its own utm_campaign, such as one per video or per newsletter issue, or share a tracked link. Every visit gets a channel, source and campaign from its first pageview, and each sale is credited under your attribution model, so the Campaign tab shows revenue per video, issue or webinar.

Does Virling read discount codes?

No. Virling credits a sale by the visit before it, not by a discount code, so code redemptions stay in your payment provider's reports. Give each affiliate a tagged link as well as a code, and compare the two.

What if buyers take weeks to enroll?

Only visits inside the lookback window before the payment are considered. The default is 90 days, and you can choose 30, 60, 90 or 365. With the default model, last non-direct, a buyer who watched a video and came back weeks later by typing your address is credited to the video, not Direct.

Is Virling open source?

Yes. Virling is open source under AGPLv3. You can run it yourself as one binary with embedded storage, or use the hosted version.

How are payment plans credited?

Each instalment counts as revenue on the day it is paid, so a three-payment plan adds to the launch month and the two months after. The second and third payments copy the channel of the first, as long as the provider ties them to the same customer, so the whole plan stays with the email or webinar that sold it.

Full reference: Model and lookback window, Tracked links and Unattributed revenue in the docs. Plans and the free trial: pricing.

Start free trial See the demo