Marketing attribution · complete guide

WooCommerce order attribution, explained

WooCommerce order attribution records where each order came from. Since WooCommerce 8.5, the store notes the source of the buyer's last visit (a search engine, another website, a tagged campaign, or a direct visit) plus device type, and saves it on the order. You see it in the Origin column under WooCommerce › Orders and in the Order attribution box on each order.

It's free, built in, and needs no Google Analytics. It also has gaps: core Analytics doesn't total it, some orders come out as Unknown, and it only credits the last click. This guide covers how it works, where to look, how to read each label, how to get totals by channel, and how to trust the numbers.

What is WooCommerce order attribution?

Order attribution answers one question per order: what brought this buyer to the store on the visit where they bought?

WooCommerce answers it with a small script on your storefront. When someone lands on your site, the script looks at the link they arrived from and any UTM parameters in the URL, and stores what it found in cookies in their browser. When they check out, that information is sent along with the order and saved as order meta. If they never buy, nothing is saved on your server.

That design has two consequences worth keeping in mind:

  • It only knows about buyers. It can tell you that 40 orders came from Instagram. It can't tell you that 4,000 people visited from Instagram, so it can't give you a conversion rate by channel.
  • It only knows about one visit. The cookies last for the browser session. A customer who found you through a Facebook ad last week and came back today by typing your address may be credited to Facebook (if the cookies survived) or to Direct (if they didn't).

How does WooCommerce decide where an order came from?

WooCommerce uses a last-click attribution model: the last identified source before the order gets all the credit. The WooCommerce documentation spells out the rules for when a new visit replaces the source already stored:

New visit arrives from Does it replace the stored source?
A URL with UTM parameters Yes, always
A search engine (organic) Yes, always
Another website (referral) Only if no session is active. Within the same 30-minute session, never
No referrer (typed address, bookmark) Never. A direct visit doesn't overwrite a known source

So if a shopper clicks your newsletter link (tagged with UTMs), browses, then opens a new tab and types your address to finish buying, the order is still credited to the newsletter. If they come back from a Google search, Google takes the credit.

What gets saved on each order

The data is stored as order meta with the prefix _wc_order_attribution_. The main keys:

Meta key What it holds
_wc_order_attribution_source_type The kind of source: utm, organic, referral, typein (direct), admin, and a few others
_wc_order_attribution_utm_source The source name: the utm_source value, the search engine, or the referring site's host name
_wc_order_attribution_utm_medium The medium, such as email, cpc or referral
_wc_order_attribution_utm_campaign The utm_campaign value, if the link had one
_wc_order_attribution_referrer The full URL of the page the visitor came from
_wc_order_attribution_device_type Mobile, Tablet or Desktop, worked out from the browser's user agent
_wc_order_attribution_session_pages Pages viewed in the session before buying

WooCommerce also stores utm_content, utm_term, utm_id, the session entry page, the session start time, a visit count and the user agent.

Where to see order attribution in WooCommerce

There are two places in core WooCommerce, both order by order.

  1. The Orders list. Go to WooCommerce › Orders. The Origin column shows a short label for each order, such as "Direct", "Organic: Google", "Referral: Facebook.com" or "Source: newsletter". If you don't see it, open Screen Options at the top right and tick it.
  2. The order screen. Open any order. The Order attribution box shows the origin, source type, UTM campaign and medium (for tagged visits), device type and session page views. Next to it, the Customer history box shows that customer's order count, revenue and average order value.

That's the whole built-in interface. Core Analytics has no attribution report that adds these up, which is the main gap the rest of this guide deals with.

What Direct, Organic, Referral and Unknown mean

The Origin label is built from the source type and the source. Here's what each one means and how far to trust it.

Origin label Source type What it means
Source: name utm The visitor arrived on a link with UTM parameters. Name is the utm_source value
Organic: engine organic The visitor came from a search engine's unpaid results
Referral: site referral The visitor clicked a link on another website, such as a blog, a forum or a social network
Direct typein No referrer and no UTMs: a typed address, a bookmark, or a link from an app or email client that didn't pass a referrer
Web admin admin Someone created the order in WordPress admin
Mobile app, Point of Sale mobile_app, pos Orders created from the WooCommerce mobile app or point-of-sale flow
Unknown none No attribution data was saved on the order

Two of these deserve a closer look.

Direct is bigger than it looks. Many apps and email clients open links without telling the browser where the click came from. Those visits arrive with no referrer, so they land in Direct unless the link carried UTM parameters. That's the main reason to tag every link you control, covered in how to track UTM campaigns in WooCommerce.

Unknown means "no data", not "no source". It covers orders placed before the feature was switched on, orders where the shopper's browser didn't run or keep the tracking script, and orders created outside the storefront checkout. Why order attribution says Unknown walks through each cause and what you can fix.

For the meaning of each source type in one place, see the glossary entry on source type.

How to see orders and revenue by channel

Looking at the Origin column one order at a time tells you very little. The useful question is "how many orders and how much revenue did each channel bring this month, and is that up or down?" Core WooCommerce can't answer it directly. You have four options:

  1. WooCommerce's free WooCommerce Analytics extension. Core Analytics has no attribution report, but WooCommerce offers a separate free extension, confusingly also called WooCommerce Analytics, that adds five Order Attribution reports: Orders by Channel, by Source, by Campaign, by Device, and by Channel and Source. It's in early access and is added from My subscriptions on WooCommerce.com. The caveats: attribution tracking must be on, it only covers orders placed after WooCommerce 8.5 (or after you enabled tracking), your site connects to WordPress.com so the data syncs there, and it supports single-currency stores only.
  2. Export and pivot. Use an order export plugin that can include custom order meta, export the period, and build a pivot table on the _wc_order_attribution_source_type or _wc_order_attribution_utm_source columns.
  3. SQL. Join the Analytics order table to the attribution meta. There's a query below.
  4. Ask a tool that reads attribution. Askshelf groups orders and net sales by source type, UTM source, medium, campaign or device, covered further down.

The step-by-step for each is in how to see which channels bring the most orders.

For developers: orders and net sales by source type in SQL

This uses wc_order_stats, the Analytics order table, so the sales figures match Analytics' definition of net sales (after coupons, before tax and shipping). On an HPOS store the attribution meta lives in wp_wc_orders_meta:

SELECT COALESCE(NULLIF(m.meta_value, ''), '(none)') AS source_type,
       COUNT(*) AS orders,
       ROUND(SUM(s.net_total), 2) AS net_sales
FROM wp_wc_order_stats s
LEFT JOIN wp_wc_orders_meta m
  ON m.order_id = s.order_id
 AND m.meta_key = '_wc_order_attribution_source_type'
WHERE s.parent_id = 0
  AND s.date_created >= '2026-10-01' AND s.date_created < '2026-11-01'
  AND s.status NOT IN ('wc-pending', 'wc-failed', 'wc-cancelled', 'wc-refunded', 'wc-checkout-draft')
GROUP BY source_type
ORDER BY orders DESC;

On a store that still uses posts storage, swap the join for LEFT JOIN wp_postmeta m ON m.post_id = s.order_id AND m.meta_key = '_wc_order_attribution_source_type'. Change wp_ if your prefix differs, and match the status list to your Analytics › Settings › Excluded statuses. parent_id = 0 leaves out refund rows, so this is net sales before refunds. Swap the meta key for _wc_order_attribution_utm_source, _utm_medium, _utm_campaign or _device_type to group by those instead.

Common attribution questions store owners ask

Once you can see totals, the questions get more specific. Each of these has its own guide.

Why attribution numbers don't match Google Analytics or your ad platform

Expect your WooCommerce attribution totals to differ from Google Analytics, Meta Ads Manager or your email tool. They aren't measuring the same thing:

  • Different models. WooCommerce credits the last identified source. Ad platforms usually credit any order within a window after someone clicked or viewed an ad, so the same order can be claimed by Meta, Google and your email tool at once. In WooCommerce it belongs to one channel.
  • Different memory. WooCommerce's cookies last for the browser session. A shopper who clicks an ad today and buys tomorrow in a new session may show as Direct in WooCommerce and as an ad conversion in the ad platform.
  • Different counting. WooCommerce attribution sits on the order, so refunds, cancelled orders and excluded statuses follow your store's rules. Analytics tools count conversions when they fire.
  • Consent. If your store uses a consent banner that works with the WP Consent API, WooCommerce only tracks visitors who accept marketing cookies. Those who decline still buy, but their orders have no attribution.

None of these sources is "right". WooCommerce's numbers are the most conservative, and they're tied to real orders in your database, which makes them a good baseline for comparing channels against each other.

How to get cleaner attribution data

Most attribution problems come from the data going in. These habits fix the bulk of them:

  1. Check the feature is on under WooCommerce › Settings › Advanced › Features. Orders placed while it's off can't be filled in afterwards.
  2. Tag every link you control with UTM parameters: emails, social bios and posts, influencer links, QR codes, ads that don't auto-tag. Keep a short naming list (utm_source=instagram, never Instagram one week and ig the next).
  3. Test a purchase yourself. Visit the store with a test UTM link in a private window, place an order, and check the Order attribution box shows what you expect.
  4. Watch your Unknown share. If it jumps after a plugin change, a firewall rule or a new consent banner, something is blocking the tracking cookies. WooCommerce's docs note that some web application firewall rulesets block them, and since WooCommerce 9.0 a filter (wc_order_attribution_use_base64_cookies) can encode the cookies to avoid that.
  5. Read trends, not single orders. One order labelled Direct tells you nothing. Direct share rising from 20% to 35% over three months tells you something changed.

The quick way: ask Askshelf

Askshelf adds Analytics › Askshelf to WordPress admin. Its "orders by channel" lookup reads WooCommerce's attribution meta and groups orders and net sales by source type, UTM source, UTM medium, UTM campaign or device type, for any date range, optionally compared with an earlier period. It uses the same order statuses and date type as your Analytics settings.

Askshelfexample answer

Where did October's orders come from, compared with September?

Organic search brought the most orders in October: 142 orders and $8,310 in net sales, up 12% on September. Direct came second with 118 orders ($6,940), then Referral with 61 ($3,480) and UTM-tagged links with 54 ($4,120). 9 orders had no attribution data.Orders by channel, grouped by source type, 1–31 October, compared with the previous period
An example on a demo store. In your store, the numbers come from your own orders.

You can follow up with "now by UTM campaign" or "split by device". What it won't do: group by the full referring URL, total profit or return on ad spend, or tell you anything about individual customers. It's free for 10 questions a month, and the order attribution page shows more examples.

Where to start

If you've never looked at your attribution data, do it in this order:

  1. Confirm the feature is on and add the Origin column to your Orders list.
  2. Get one month of orders and net sales by channel and note your Unknown and Direct share.
  3. If Unknown is high, work through the Unknown source checklist.
  4. Start tagging links with UTM parameters so next month's Direct shrinks.
  5. Before your next sale, decide how you'll measure the campaign and whether the coupon pays for itself.

For how attribution fits with the rest of your numbers, the WooCommerce sales reports guide covers the reports core Analytics does include, and comparing two date ranges explains how to read period-over-period changes without fooling yourself.

Common questions

Is WooCommerce order attribution on by default?

It shipped in WooCommerce 8.5 and can be switched on or off under WooCommerce › Settings › Advanced › Features › Order Attribution. Check that screen on your own store, because orders placed while it was off have no attribution data and can't be filled in later.

Does WooCommerce order attribution replace Google Analytics?

No. It records one thing per order: where the buyer's last visit came from, plus device and page views for that session. It doesn't track visitors who don't buy, so it can't give you traffic, bounce rate or conversion rate.

Which attribution model does WooCommerce use?

Last-click. The source of the visit that led to the order gets all the credit, with two exceptions: a direct visit never replaces a known source, and a referral doesn't replace the source within the same 30-minute session.

Can I see order attribution totals in WooCommerce Analytics?

Not in core Analytics, which has no attribution report. You can add WooCommerce's separate WooCommerce Analytics extension, export orders with their meta, query the database, or use a tool such as Askshelf that groups orders by channel.

See how Askshelf handles this: Order attribution reports for WooCommerce