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

See which channel sells your WooCommerce downloads.

For WooCommerce stores that sell ebooks, templates, presets, courses and other digital products. Virling ties each download order to the channel, campaign and post that brought the buyer, so you see which launch post, newsletter or search result brought the money, not just the clicks. Open source under AGPL, hosted or self-hosted.

Start free See the demo

A download buyer often reads a post or a newsletter, leaves, and comes back days later by typing the address, so WooCommerce's own attribution can mark the order as Direct or Unknown. Virling saves a visitor ID on the order at checkout and credits it to the visits before it, skipping Direct ones. The WooCommerce docs cover the join itself.

Guest checkout for downloads

  • No account needed. The snippet saves the visitor ID on the order itself, so a guest who buys an ebook is credited to the visit that brought them, with no login.
  • Each guest order stands alone. A guest order has no WooCommerce customer ID, so it cannot be linked to an earlier order. A guest's second purchase is credited to the visits before it, such as the newsletter that announced the new template.
  • Buyers with an account. Any later order by the same account keeps the channel of their first paid order, like a renewal. If you want each purchase credited to its own visit, leave guest checkout on.
  • Guests without a visitor ID. Virling compares the billing email with identify events, so a buyer who gave you their email on the site, such as at a newsletter signup, can still be matched.

Bundles and coupons

  • A bundle is one payment. Virling reads the order total, not its line items, so three templates in one order count as one payment at the bundle price, credited to one visit.
  • Products show as landing pages. The landing page of the credited visit is the product page or post the buyer arrived on, which tells you which download or which article started the sale.
  • Coupons are already taken off. The order total is what the buyer paid after the coupon. Coupon codes are not read, so to measure a promotion, share the code with a tagged link and read it on the Campaign tab.
  • Free downloads are skipped. An order with a total of 0, from a free product or a 100% coupon, is not imported.

Which post or newsletter sold a download

Every visit gets one channel from its first pageview: Paid, Email, AI, Organic search, Communities, Social, Referral or Direct. The dashboard lists visitors, revenue and revenue per visitor for each channel, source, campaign and landing page, so a tutorial that sent many readers and no sales stands apart from a short post that paid. For newsletters and bio links, share a tracked link or a link with UTM tags, one per issue or placement, and the Campaign tab shows the revenue each one brought.

Refunds on downloads

  • Full and partial refunds. A refund lowers the revenue of its order, on the order's date and in the channel it was credited to. Refunding one file out of a bundle lowers the order by that amount only, and an order set to Refunded counts as fully refunded.
  • When they show. Orders from the last 60 days are read again every 6 hours, so a refund can take that long to show, and one on an older order is not picked up automatically.
  • Refund rate by channel. The Retention page shows the share of buyers from each channel who got a refund, so a channel that sells many downloads that come back stands out.

See which channel sells your downloads

For WooCommerce stores that sell digital downloads. 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

Set it up

  1. Put the script on the store. Add the store in Virling and paste the script on every page, product pages and blog posts alike. Keep cookies on: the visitor ID lives in the virling_vid cookie.
  2. Paste a read key. Under WooCommerce, Settings, Advanced, REST API, create a key with Read permission and paste it as ck_...:cs_... with the store address. The store must answer over https at /wp-json/wc/v3/.
  3. Copy the visitor ID to each order. Paste this into functions.php or a snippets plugin. It works for guest and account checkouts alike.
add_action('woocommerce_checkout_create_order', 'virling_vid_on_order');
add_action('woocommerce_store_api_checkout_update_order_from_request', 'virling_vid_on_order');
function virling_vid_on_order($order) {
  $vid = $_COOKIE['virling_vid'] ?? '';
  if (preg_match('/^[A-Za-z0-9-]{8,64}$/', $vid)) $order->update_meta_data('virling_vid', $vid);
}

WooCommerce order attribution says Unknown explains why orders lose their source. Every WooCommerce detail is on the WooCommerce integration page, and other providers are on revenue attribution for digital products.

Test it with a guest download

  1. Give the test product a price. A free download is not imported. With Cash on delivery, WooCommerce puts an order with a downloadable file on hold, so set it to Completed yourself.
  2. Buy as a guest from a tagged link. In a private window, open the product with ?utm_source=test&utm_medium=email on its address and check out without an account.
  3. Check the order and the payment. The order's custom fields should include virling_vid, and after the next sync the payment shows the Email channel on /app/yourdomain.com/payments.

How each download order is credited

OrderWhat Virling readsHow it is credited
Guest orderTotal, currency, payment date, billing email and virling_vid, with no customer IDTo that buyer's visits before it, by default the latest in the last 90 days that was not Direct, or by email match
First order with an accountThe same fields plus the customer IDThe same way as a guest order
Later order with an accountAnother order by the same customer IDKeeps the channel of that account's first paid order
Bundle or coupon orderThe order total after discounts, not the products or the coupon codeOne payment, credited like any other order
Free downloadNothing: an order with a total of 0 is not importedNo payment and no credit
RefundEach refund on the order, read again for 60 daysLowers that order's revenue in its channel

What to know

  • Orders placed before the snippet was added have no visitor ID and are Unattributed, unless their billing email matches. They still count toward revenue.
  • A buyer who pays without first visiting a page that runs the script, such as from a direct checkout link in an email, has no visit to credit.
  • An order on hold, such as a bank transfer not yet received, waits until it is Processing or Completed.

If you also sell a paid library or club that renews, WooCommerce Subscriptions by channel covers renewals, subscription status and retention.

Frequently asked questions

Which channel sells my WooCommerce downloads?

Each paid download order is credited to the buyer's visits before it, by default the latest in the last 90 days that was not Direct. The dashboard then shows revenue per channel, source, campaign and landing page, so a launch post, a newsletter issue and a search result can be compared by what they sold.

How do I see which post or newsletter brought a download sale?

Share a tracked link or a link with UTM tags in each post, newsletter or bio instead of your plain URL. Visits from it carry those tags, so the Campaign tab shows the revenue each one brought.

Do guest download orders link to a visit?

Yes. The snippet saves the visitor ID on the order itself, so the buyer needs no account. A guest order has no customer ID, so a guest's next order is credited to its own visit.

Are free downloads counted?

No. Orders with a total of 0, such as a free download, a lead magnet or an order paid in full by a coupon, are not imported, so they add no payment and no customer. The buyer's first paid order is credited from its own visitor ID.

Can I see revenue per product or per bundle?

Not directly. Virling reads the order total, not its line items, so a bundle is one payment. The landing page of the credited visit shows which product page or post the buyer arrived on.

Are refunded downloads taken off?

Yes. A full or partial refund lowers the revenue of its order, on the order's date and in its channel. Orders from the last 60 days are read again every 6 hours, so a later refund shows up, and one on an older order is not picked up.

Full guides: WooCommerce in the docs, Model and lookback window and Tracked links.

Start free