virling Pricing Self-host Demo Changelog Agencies GitHub Start free trial
integrations / dodo payments for digital products

See which channel sells your ebooks, templates and courses on Dodo Payments.

For creators who sell ebooks, templates, courses and other digital downloads through Dodo Payments. Virling ties each payment to the channel and campaign that brought the buyer, so you see which launch post, newsletter or creator brought the money, not just the clicks. Open source under AGPL, hosted or self-hosted.

Start free trial See the demo

Dodo Payments records who bought and how much, but not the visit that brought them. A launch post, a newsletter mention or a creator's video sends a wave of visitors, and a few of them buy. Virling joins the two through the visitor ID the script passes into checkout, and reads Dodo Payments with an API key, without changing anything there.

What you get

  • Each sale credited to a channel and campaign. Payments are imported and joined to the visits before them. Every visit gets one channel from its first pageview: Paid, Email, AI, Organic search, Communities, Social, Referral or Direct. By default a payment goes to the latest visit in the last 90 days that was not Direct.
  • Revenue per source, campaign and landing page. The dashboard lists visitors, revenue and revenue per visitor for each channel, source, campaign and landing page, so a post that sent many visitors and no sales stands apart from a small one that paid.
  • Newsletters and creators measured by sales. Hacker News, Reddit and Product Hunt count as Communities, and a link tagged utm_medium=newsletter counts as Email. Give each sponsor or creator a tagged link and compare them by revenue.
  • Refunds and disputes taken off. Refunds update the payment they belong to, and lost or accepted disputes count as refunded, since the money went back to the buyer. The last 30 minutes are read again on each round, so payments that succeed late are not missed.
  • Only the products of this site. If one Dodo account sells more than this store, list its product IDs under Only these product IDs and Virling imports only those payments.
  • Time to pay. The Time to pay card shows the median time from first visit to first payment per channel, so you see how long buyers from each channel take to decide.

Set it up

  1. Add the site. Click + Add a site and enter your domain, such as yourstore.com, and its timezone.
  2. Install the script. Paste the tag before </head> on every page that links to your Dodo Payments checkout. Leave cookieless mode off, since checkout needs the visitor ID.
  3. Connect Dodo Payments. Create an API key in the Dodo Payments dashboard and paste it under payments. Live mode and test mode keys both work. The last 90 days are imported, then new payments every minute.
  4. Link checkout to visits. Static payment links on checkout.dodopayments.com/buy/... need no code: keep the link as a normal <a href> on a page that runs the script, and the script adds metadata_virling_vid=<visitor ID>, which Dodo stores as the payment's metadata.virling_vid. For a checkout session you create on your server, set virling_vid in metadata from the cookie. For a payment link URL you build in the browser:
const url = new URL("https://checkout.dodopayments.com/buy/pdt_...");
const vid = window.virling?.vid?.();
if (vid) url.searchParams.set("metadata_virling_vid", vid);
location.href = url.href;

Make a test purchase from a page that runs the script, wait for the next sync, and the payment shows a channel instead of Unattributed. The full walkthrough is in how to track Dodo Payments revenue by traffic source, and Dodo Payments UTM tracking covers passing source data through checkout. Every setting is on the Dodo Payments integration page, and other providers are on revenue attribution for digital products.

What you do, and whether the sale is linked

What you doCan the sale be linked?Why, or what it takes
Share your sales page in a post or a bioYesThe post brings a visit, and the payment link on your page carries the visitor ID
Share a payment link in a post, a QR code or on another siteNoThe payment has no metadata.virling_vid, since your page was skipped
Send your list to your sales pageYesTag the link utm_medium=newsletter so the visit counts as Email
Send your list a payment linkNoPut the payment link on a page that runs the script and email that page
Use a static payment link on your own siteYesNo code for a normal <a href> to checkout.dodopayments.com/buy
Open a payment link from your own codeYes, if you add the IDSet metadata_virling_vid on the URL, as in the snippet above
Create a checkout session on your serverYes, if you pass the IDSet virling_vid in metadata from the cookie
List the product on a marketplaceOnly if the listing sends buyers to your site and they pay through your Dodo checkoutA sale the marketplace bills itself never passes through your Dodo checkout, so Virling does not see it

Dodo payments that are not linked are kept in total revenue and shown as Unattributed, so the sum of your channels can be lower than the total. A repeat purchase by a customer whose first payment was linked keeps that channel, even from an emailed payment link.

A made-up example: three channels, one course

The numbers below are invented. A teacher sells an $80 course through Dodo Payments and compares a quarter of sales, with no refunds:

Made upVisitorsSalesRevenueRevenue per visitor
Social1,6004$320$0.20
Paid8008$640$0.80
Organic search6009$720$1.20

Read from the top, Social is the biggest channel by visitors and the smallest by money. Paid earned twice as much from half the visitors, but $0.80 per visitor is also the limit on its ads: if a visitor costs more than $0.80 in ad spend, the campaign loses money before any fees. Organic search earned the most from the fewest visitors, so a post that ranks is worth more here than one that is shared.

What to know

  • Sales made before the visitor ID was passed into checkout are Unattributed. They still count toward revenue.
  • A buyer who pays from a link in an email or a DM, without visiting your site first, has no visit to credit and is Unattributed.
  • Payment links must be normal <a href> links on a page that runs the script. Nothing is added in cookieless mode.
  • To stay inside Dodo's limit of 240 requests per minute, Virling makes at most a couple of extra lookups per round, so a large backfill can take a few minutes to finish.

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

How do I see Dodo Payments sales by traffic source?

Connect Dodo Payments to Virling with an API key and add the Virling script to your site. Static payment links on checkout.dodopayments.com need no code: the script adds the visitor ID, and Dodo stores it in the payment metadata. Each sale is then credited to the visit before it, with its channel, source, campaign and landing page.

Do I need to write code for Dodo Payments payment links?

No. Normal links to checkout.dodopayments.com/buy/... on a page that runs the script get metadata_virling_vid added when the page loads and when a visitor clicks. Only a checkout session you create on your server needs virling_vid set in its metadata.

Which newsletter or creator brought a sale?

Tag the link you give them with utm_source and utm_medium=newsletter, or make a tracked link. Every visit gets a channel, source and campaign from its first pageview, so the Source and Campaign tabs show revenue per newsletter, creator or post.

Does Virling change anything in my Dodo Payments account?

No. Virling only reads payments, refunds and subscriptions, and never creates, changes or refunds anything. Live mode and test mode keys both work.

Can I test a Dodo Payments link before I launch?

Yes, with one extra step. The script does not add the visitor ID to test links, so add metadata_virling_vid to the test link in your own code, or use a test checkout your server creates with virling_vid in its metadata. Connect a test mode key first.

Full guides: Dodo Payments in the docs, Link checkout to visits and Tracked links.

Start free trial