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

See which channel brings your WooCommerce subscribers.

For WooCommerce stores that sell subscription boxes, replenishment products or memberships with WooCommerce Subscriptions. Virling ties each first order and every renewal to the channel that brought the subscriber, so you compare channels by the subscribers who keep paying, not by first orders alone. Open source under AGPL, hosted or self-hosted.

Start free trial See the demo

WooCommerce Subscriptions creates each renewal order on a schedule, with no visit behind it, so on its own a renewal looks like Direct or Unattributed revenue. Virling credits the subscriber's first order from the visitor ID saved on it at checkout, then gives every renewal the channel of that first order. How the visit and the order are joined is in the WooCommerce docs.

Renewal orders and what they are credited to

  • Marked by WooCommerce Subscriptions. Every renewal order it creates has a _subscription_renewal key in its meta data, and Virling marks those orders as renewals.
  • Credited to the first paid order. A renewal copies the channel, referrer, campaign, landing page, country and device of the customer's first paid order, matched by WooCommerce customer ID. If someone subscribed after a visit from Reddit, every renewal is credited to that visit, even years later.
  • No credit to copy, no guess. If the first order was not credited, the renewal falls back to its own visitor ID. A scheduled renewal almost never has one, so it stays Unattributed but still counts toward revenue.
  • Renewals paid by hand. A renewal the subscriber pays from the link in their email is still a renewal order, so it keeps the first channel instead of the visit that paid it.

Free trials and sign-up fees

  • A trial with no fee. It starts with a $0 order, and Virling skips orders with a total of 0. The first paid renewal then has no first order to copy, so it is credited only through its own visitor ID or a billing email that matches an identify event sent at sign-up.
  • A trial with a sign-up fee. The fee is charged on the first order even while the trial delays the first recurring charge, so that order is imported with the visitor ID from checkout, and the renewals after the trial keep its channel.
  • The fee counts as revenue. Virling reads the order total, not its line items, so a sign-up fee and the first period's price in the same order are one payment.

Switching plans

When a subscriber upgrades or downgrades and WooCommerce Subscriptions charges a prorated amount, it creates a switch order. Virling does not read the switch marker, but the switch order is a later order by the same account, so it counts as a renewal and keeps the channel of the first order. A switch with nothing to pay makes no payment in Virling. The subscription's new price reaches MRR at the next hourly status read.

The subscription status Virling reads

Once an hour, with the same read-only key, Virling lists your subscriptions from /wp-json/wc/v3/subscriptions and keeps each one's status, total, currency, billing period, billing interval and end date.

StatusStill paying?
activeYes
pending-cancelYes, until its end date
on-holdNo. A subscription on hold after a failed renewal drops out until it is active again
cancelled, expired and any otherNo

When a customer has any subscription, its status decides, even if they also placed one-off orders. MRR adds up the totals of live subscriptions per month, converted to USD. The Retention page groups subscribers by the channel of their first paid order, so a channel that brings many first boxes and few second ones stands out next to a smaller channel whose subscribers stay. Without WooCommerce Subscriptions there is no status to read, and Retention falls back to payment recency.

See which channel brings subscribers who renew

For WooCommerce stores that sell subscriptions. 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. Add the store as a site. Paste the script on every page with cookieless mode off, so the first order has a visitor ID to carry.
  2. Connect one read-only key. Add a WooCommerce REST API key with Read permission and paste it in Virling as ck_...:cs_... with the store address. The same key reads orders and subscriptions, so there is nothing else to grant.
  3. Save the visitor ID on the first order. Add this to your theme's functions.php, or to a snippets plugin. Renewals need nothing extra: they take their channel from the first order.
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);
}

Subscription renewal attribution explains why renewals should keep the first channel, and the MRR calculator turns subscriber counts and prices into monthly recurring revenue. Every WooCommerce detail is on the WooCommerce integration page.

Test it with a subscription order

  1. Pick a gateway that renews. Use your gateway's test mode. Cash on delivery shows at checkout only when manual renewals are accepted in the WooCommerce Subscriptions settings.
  2. Subscribe from a tagged link. In a private window, open the subscription product with ?utm_source=test&utm_medium=email on its address and subscribe with a new account. Pick a plan that charges on day one, or one with a sign-up fee, since a $0 trial order is not imported.
  3. Look for the visitor ID. The first order's custom fields should include virling_vid.
  4. Watch it renew. After the next sync the first order shows the Email channel on /app/yourdomain.com/payments. When the test subscription renews, the renewal order shows a Renewal badge with the same channel.

How each subscription order is credited

OrderWhat Virling readsHow it is credited
First paid orderTotal, currency, payment date, customer ID, billing email and virling_vidTo the subscriber's visits before it, by default the latest in the last 90 days that was not Direct
Renewal orderThe _subscription_renewal meta key, or any later order by the same accountKeeps the channel of the account's first paid order
Switch orderA later order by the same account with a prorated chargeKeeps the channel of the account's first paid order
$0 trial orderNothing: orders with a total of 0 are not importedThe first paid renewal after it is credited only through its own visitor ID or an email match
SubscriptionStatus, total, billing period and interval, end date, once an hourNot a payment. It decides Still paying and MRR

What to know

  • Renewal detection and subscription status need WooCommerce Subscriptions. Without it, each order is attributed on its own and Retention uses payment recency.
  • The first payment must be in Virling. Orders older than the 90-day backfill are not imported, so renewals of subscriptions that started before that are usually Unattributed.
  • A renewal paid later than it was created, after a failed attempt, can take up to 6 hours to show, because orders from the last 60 days are read again every 6 hours.
  • Customers are matched per provider. A subscriber who moved to your store from another payment provider counts as two customers.

If you also sell one-time files, see WooCommerce digital downloads by channel.

Frequently asked questions

Which channel brings my WooCommerce subscribers?

The channel of each subscriber's first paid order. Every renewal WooCommerce Subscriptions creates after it copies that channel, so the Retention page can compare channels by subscribers who are still paying, not by sign-ups.

How are WooCommerce Subscriptions renewals attributed?

A renewal order carries the _subscription_renewal meta key, so Virling marks it as a renewal. It copies the channel, referrer, campaign, landing page, country and device of the customer's first paid order, matched by WooCommerce customer ID, even years later and even though the renewal itself has no visit.

Does an on-hold WooCommerce subscription count as still paying?

No. Only active subscriptions, and pending-cancel ones until their end date, count as live. A subscription put on hold after a failed renewal payment drops out of Still paying, and comes back once a renewal is paid and the subscription is active again.

How is a free trial with a sign-up fee credited?

The sign-up fee is charged on the first order, so that order has a total above 0, is imported and carries the visitor ID from checkout. The renewals after the trial keep its channel. A trial with no fee starts with a $0 order, which is not imported, so the first paid renewal is credited only through its own visitor ID or an email match.

Is a plan switch credited to the channel that brought the switch?

No. A switch order with a prorated charge is a later order by the same account, so it keeps the channel of the subscriber's first paid order, like a renewal. A switch with nothing to pay adds no payment.

What happens to subscriptions that started before I connected Virling?

The first run imports orders from the last 90 days. A renewal whose first order is older than that has no first payment in Virling to copy, so it is usually Unattributed. It still counts toward revenue.

Full guides: WooCommerce in the docs, Renewals and Retention by channel.

Start free trial