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

Which channel brings your store orders.

Virling joins each Shopify or WooCommerce order to the visit that came before it, so you see orders and revenue by channel, campaign and landing page, how much of it is really Direct, and which first source brings buyers who come back. Open source, one Rust binary, or hosted.

Start free trial See the demo

The demo opens on the Channels card, with visitors, revenue and revenue per visitor for each channel. It is sample data for a made-up invoicing tool, not a store, so it shows payments, not store orders.

An order and the visit that led to it are usually recorded in different tools. Virling joins them: a visitor ID set when someone lands, stored on the order at checkout, and matched to that visitor's sessions when the order comes in. New to attribution? Start with the plain guide to ecommerce attribution.

Connect your store

  • Shopify: a custom app token with only the read_orders scope, and a short snippet in theme.liquid that stores the visitor ID on the cart. Shopify copies cart attributes onto the order.
  • WooCommerce: a REST API key with Read permission, and a short snippet in functions.php that saves the visitor ID on each new order, for the classic and the block checkout.

Neither key can change products, customers or orders. Shopify orders from the last 60 days and WooCommerce orders from the last 90 days are imported on the first run, then new orders every minute. Refunds lower an order's revenue once Virling reads them.

Selling without Shopify or WooCommerce? See stores on Stripe Checkout or Payment Links. Running stores for clients? See sales by channel for each Shopify client.

What links an order, by store

StoreWhat links an orderWhat needs a settingWhat stays Unattributed
Shopifyvirling_vid in the order's note attributes, which Shopify copies from the cartThe read_orders token, the myshopify.com address and the snippet in theme.liquid. A headless store sets the cart attribute from its own codeOrders whose cart was made outside your storefront: cart permalinks, Buy Button embeds and other sales channels. A button that skips the cart may leave the ID out too
WooCommercevirling_vid in the order's meta data, read from the cookie at checkoutA REST API key with Read, https, pretty permalinks and the snippet in functions.phpOrders created in the admin or by another system, and orders from a gateway or express button outside the classic and block checkout
Stripevirling_vid in the metadata of the charge, its PaymentIntent or the Checkout Session, or the session's client_reference_idA restricted key with Read access. Your server sets the ID on Checkout Sessions and PaymentIntents. Payment Links on buy.stripe.com need only the scriptPayment Links opened from an email, a QR code or another site, and sessions that carry your own number in client_reference_id and no metadata.virling_vid

On all three, leave cookieless mode off, and expect orders from before the setup, or from visitors who block the script, to be Unattributed too. There are two ways back. An order with no visitor ID is credited when its email exactly matches one your site sent as an identify event before the order synced, and it shows Matched by email. And a later order by a customer whose first order was credited keeps that channel, with or without an ID of its own.

Orders and revenue per channel

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, with a chip that compares each row with your site average.

  • Revenue per visitor is the number to watch. A channel with many visitors and a low chip sends traffic that does not buy.
  • Orders. Click a channel to filter the whole dashboard by it. The funnel's Paid step then shows how many of its visitors placed an order.
  • Refunded on the Channels card shows the share of a row's orders refunded in whole or part, so a channel full of returns stands out.
  • Before paying on the Pages card shows the last page a buyer saw before the order.
  • Recent customers lists the last 10 buyers with their first source, visits before paying and time to convert.
The demo Channels and AI cards, with visitors, revenue and revenue per visitor for each row
Sample data from the live demo, a made-up invoicing tool, not a store.

Each site has one attribution model. Last non-direct is the default: a buyer who found you through a post and came back a week later by typing your address is credited to the post. First touch and last touch are the other choices, and the lookback window can be 30, 60, 90 or 365 days.

Read the report: an example

These numbers are made up, to show how to read the report. They are not from a real store and not a benchmark. Every order is $50, and every refund is for the whole order:

ChannelVisitorsOrdersRefundedRevenueRevenue per visitor
Paid5,0006020%$2,400$0.48
Organic search3,000405%$1,900$0.63
Email60030-$1,500$2.50
Direct1,90025-$1,250$0.66
Social4,000205%$950$0.24
Unattributed-15-$750-
Total14,5001908%$8,750$0.55

Each visitor is counted under one channel here, so the rows add up. The Orders column and the Unattributed and Total rows are added for this example; the Channels card shows visitors, revenue, revenue per visitor and Refunded, and the matched revenue line covers the Unattributed part. Revenue is net of refunds, and the site average of $0.55 is matched revenue per visitor, so it leaves out Unattributed. Paid brings the most orders and the most revenue, but 12 of its 60 orders came back, which cost it $600 and put it below the average before you take off the ad spend. Click Paid, then open the Campaign tab to see which ad the returns follow. Email has the fewest visitors and the highest revenue per visitor. Social sent 4,000 visitors who were worth $0.24 each, so look at the page they land on before you post more. Unattributed is $750 of $8,750, about 9% of revenue, so the other rows hold most of the story. If those 15 orders are point-of-sale or staff orders, there is nothing to fix; if they came through your online store, check the snippet.

See which channel brings your orders

For Shopify and WooCommerce stores, Virling credits each order to the visit that led to it. It 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

Direct and unknown origin

A visit is Direct when it arrives with no referrer, no UTM tag and no source Virling can read. In a store that is rarely someone typing your address. Untagged email and SMS links, QR codes, links in PDFs and links from your own blog on another domain all land as Direct. The common causes and fixes are in why Shopify orders show up as Direct.

  • In-app browsers. A link opened inside Instagram, Facebook, TikTok, LinkedIn, WhatsApp or another known app is credited to that app when its browser names itself, instead of Direct.
  • Direct, split. The Channels card splits Direct by how visitors arrived: typed or bookmarked, a shared link, or a return from checkout.
  • Unattributed is not Direct. An order that reached Virling with no visitor ID, or with no visit inside the lookback window, still counts toward revenue but is listed as Unattributed. Orders created without a web visit, such as staff or point-of-sale orders, usually land here.
  • Matched revenue. A line under the dashboard numbers gives the share of revenue matched to a visit and why the rest was not, so you know how far to trust each channel.

Repeat buyers by first source

A later order by the same customer keeps the channel of their first order, so a repeat order that followed an email still counts for the channel that found the buyer. If the first order was not credited, the later one falls back to its own visit. The Retention page uses the same rule to show which channel brought customers who came back. It groups each customer by the channel, referrer and campaign of their first order, and keeps every later order under that first source.

  • Customers acquired and how many are still paying today.
  • First-payment revenue, refunded amount and net LTV, every order so far net of refunds.
  • Avg LTV, refund rate and 30-day churn.
  • Each source's share of customers next to its share of customers still paying.

A store customer is one Shopify or WooCommerce customer ID. Without a subscription, a customer is still paying while they have an order, not fully refunded, within their usual gap between orders plus 7 days. The gap is the time between their last two orders, from 7 to 366 days, or 30 days after a single order. For WooCommerce Subscriptions customers, the live subscription status decides instead. Renewal orders from Shopify Subscriptions and WooCommerce Subscriptions keep the channel of the first order on every view.

Check it with a test order

  1. Prepare the store. On Shopify, put Shopify Payments in test mode or turn on the Bogus Gateway. On WooCommerce, put your gateway in its test or sandbox mode, or turn on Cash on delivery. On Stripe, connect a restricted key that starts with rk_test_.
  2. Open a tagged link. In a private window, visit https://yourstore.com/?utm_source=test&utm_medium=email on your own domain.
  3. Place the order. In the same window, buy the way a customer would, starting from a page that runs the script. Use a new customer email, because a later order by the same customer keeps the first order's channel.
  4. Look for the visitor ID. On Shopify, the order's additional details include virling_vid. On WooCommerce, its custom fields do, and the status is Processing or Completed. On Stripe, it is in the metadata, or in client_reference_id on the Checkout Session.
  5. Look in Virling. Wait a minute or two, then open /app/yourstore.com/payments. The order shows the test source and the Email channel instead of Unattributed. Open it to see its journey. A WooCommerce order paid more than about 10 minutes after it was created can take up to 6 hours to show.
  6. Refund it. Refund the test order so it does not stay in your revenue. The refund shows within a minute or two on Shopify and within 6 hours on WooCommerce. On Stripe, refund it before you replace the test key with the live one.

If a step fails, see Test your setup.

What to know

  • Orders placed before the snippet was on your store carry no visitor ID, so they are Unattributed.
  • WooCommerce guest orders, and Shopify orders without a customer, have no customer ID, so a guest who orders again can count as a new customer.
  • Until a site has 60 days of orders, the Retention page leads with refund rate and 30-day churn instead of LTV.
  • Shopify needs the myshopify.com address, not a custom domain. WooCommerce needs https and pretty permalinks.

Frequently asked questions

How do I see which channel brings orders to my store?

Add the Virling script to the store, connect Shopify or WooCommerce with a read-only key, and add a short snippet that saves the visitor ID on each order. Virling ties each order to the visit before it and shows revenue and revenue per visitor for every channel, source, campaign and landing page.

Why do so many ecommerce orders show as Direct?

A visit is Direct when it has no referrer, no UTM tag and no source Virling can read. Untagged email and SMS links, QR codes and some in-app browsers all arrive that way. Tag the links you control, and keep the default last non-direct model so a buyer who comes back by bookmark is credited to the source that found them.

Can I see which channel brings repeat buyers?

Yes. The Retention page groups each customer by the channel, referrer and campaign of their first order, and shows how many still pay, their net lifetime value, refund rate and 30-day churn. Every later order of that customer counts toward the first channel there.

Which channel gets credit when a customer orders again?

The channel of that customer's first order, even when an email or an ad brought them back, as long as both orders carry the same customer ID and the first one was credited to a visit. WooCommerce guest orders and Shopify orders without a customer stand alone, so each is credited by its own visits.

Does Virling read discount codes?

No. Virling credits an order by the visit before it, not by a discount code, so code redemptions stay in your store's reports. Give each creator or campaign a tagged link as well as a code, and compare the two.

Full reference: Shopify, WooCommerce, Channels, Unattributed revenue and Retention by channel in the docs. Plans and the free trial: pricing.