Marketing attribution
Why WooCommerce order attribution says Unknown (and how to fix it)
WooCommerce order attribution says Unknown when no attribution data was saved on the order. The usual causes: the order was placed before attribution was switched on, the shopper declined marketing cookies on a consent banner, a firewall or script blocker stopped the tracking cookies, or the order was created outside the storefront checkout. You can fix the causes, but not old orders.
This guide explains how attribution gets onto an order, each cause of Unknown with how to check it, and how to keep your Unknown share low. For the bigger picture, see WooCommerce order attribution, explained.
How attribution gets onto an order
Knowing the path makes the causes obvious:
- A script on your storefront reads where the visitor came from and stores it in session cookies in their browser (named
sbjs_current,sbjs_first,sbjs_sessionand similar). - At checkout, the script adds those values to the checkout: as hidden fields on the classic checkout, or as extension data on the block checkout.
- When the order is created, WooCommerce saves the values as order meta starting with
_wc_order_attribution_. - If every value is empty, WooCommerce saves nothing. The order shows Unknown.
Anything that breaks steps 1–3 produces Unknown. That's different from Direct, where the script worked but the visit had no referrer and no UTM parameters. The source type glossary entry lists every label.
The causes of Unknown, and how to check each
| Cause | How to check | Can you fix it? |
|---|---|---|
| Orders placed before attribution was on | Unknown orders are all older than a certain date | No, only future orders |
| Attribution switched off | WooCommerce › Settings › Advanced › Features | Yes, switch it on |
| Shopper declined marketing cookies | You use a consent banner that works with the WP Consent API | Partly (it's the shopper's choice) |
| Firewall blocks the tracking cookies | 403 errors at checkout or on page loads with sbjs_ cookies |
Yes |
| Tracking script didn't run | No sbjs_ cookies in your own browser after visiting |
Usually |
| Order created outside the storefront checkout | Unknown orders share a creation method (API, import, renewals) | Expected |
1. Orders from before attribution was on
Order attribution arrived in WooCommerce 8.5. Orders placed before you updated, or while the feature was off, have no data. There's no way to fill them in later. If you compare this year with last year by channel, the older period will be mostly Unknown.
2. The feature is switched off
Go to WooCommerce › Settings › Advanced › Features and check Order Attribution is enabled. A developer or a plugin may have switched it off; the setting is stored in the option woocommerce_feature_order_attribution_enabled.
3. Consent banners
WooCommerce's order attribution works with the WP Consent API. If your consent plugin uses it, WooCommerce only tracks visitors who consent to the marketing category. For visitors who decline, it removes its tracking cookies and sends empty values with the order, so those orders show Unknown.
This is working as intended. You can reduce it by making your banner clear and honest, but you shouldn't try to track people who said no. Expect your Unknown share to rise when you add or change a consent banner.
4. Firewalls blocking the cookies
WooCommerce's documentation notes that some web application firewall rulesets flag the attribution cookies and block requests with a 403 error. The options it lists: update the ruleset, add an exclusion rule, encode the cookies, or switch the feature off.
To encode the cookies (available since WooCommerce 9.0), a developer can add this to a small plugin or a code snippets tool:
add_filter( 'wc_order_attribution_use_base64_cookies', '__return_true' );
If your host runs the firewall, send them the WooCommerce documentation link and ask them to check their rules.
5. The tracking script didn't run
Attribution depends on JavaScript in the shopper's browser. It won't be captured if the script never runs or can't set cookies, for example because:
- the shopper uses a browser or extension that blocks tracking scripts or cookies;
- a JavaScript error earlier on the page stops other scripts;
- an optimization plugin delays, combines or removes scripts in a way that breaks it;
- a custom or third-party checkout doesn't pass the attribution fields along with the order.
To check, open your store in a private window with a tagged URL (say ?utm_source=test&utm_medium=test), then look in your browser's developer tools under cookies for sbjs_current. Place a test order and check its Order attribution box. If the cookies are missing or the order shows Unknown, switch off optimization plugins one at a time and test again. If only one checkout method (for example an express payment button) produces Unknown orders, ask that plugin's developer whether it supports WooCommerce order attribution.
6. Orders created outside the storefront checkout
Attribution is captured at checkout. Orders created some other way don't go through that step, so they usually have no data:
- orders created through the REST API or by another system (a marketplace connector, for example);
- orders brought in by an import tool;
- automatic renewal orders from a subscriptions plugin, depending on how it creates them.
Orders an admin creates in WordPress are the exception: WooCommerce labels them Web admin, not Unknown.
For developers: measure your Unknown share by month
A steady share is your baseline. A jump points to the month something changed. On an HPOS store:
SELECT DATE_FORMAT(s.date_created, '%Y-%m') AS month,
COUNT(*) AS orders,
SUM(m.meta_value IS NULL OR m.meta_value = '') AS no_attribution,
ROUND(100 * SUM(m.meta_value IS NULL OR m.meta_value = '') / COUNT(*), 1) AS pct_unknown
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-01-01'
AND s.status NOT IN ('wc-pending', 'wc-failed', 'wc-cancelled', 'wc-refunded', 'wc-checkout-draft')
GROUP BY month
ORDER BY month;
On posts storage, join wp_postmeta m ON m.post_id = s.order_id instead. Change wp_ if your prefix differs. This counts orders with no source type, which is what WooCommerce shows as Unknown.
What Askshelf shows for Unknown orders
Askshelf adds Analytics › Askshelf to WordPress admin. Its "orders by channel" lookup groups orders and net sales by source type, UTM source, medium, campaign or device, and puts orders with no attribution data in a (none) row, so you can see the size of the gap next to your real channels. With a comparison period, you can spot a month where it jumped.
How many October orders had no attribution data, compared with September?
Askshelf can tell you how many orders lack attribution, but not why: it doesn't see your consent settings, firewall or plugins. Use the checklist above for the cause. More on the order attribution use case page.
Keeping Unknown low
- Test a tagged order after every big change: a new theme, checkout plugin, caching or optimization setting, firewall rule or consent banner.
- Check the share monthly with the query above or a channel report, as in how to see orders by channel.
- Don't compare channels across the switch-on date. Periods before attribution was on are mostly Unknown, so year-over-year channel comparisons start a year after you turned it on.
- Tag your links so the orders that are tracked land in the right channel, as covered in how to track UTM campaigns.
- If your channel totals still don't match other reports, why Analytics numbers don't match your orders covers status and date differences.
Common questions
Can I fix Unknown on old WooCommerce orders?
No. Attribution comes from the shopper's browser at the moment of checkout. If nothing was captured then, there's nothing to recover. Fixes only help orders placed after them.
Is Unknown the same as Direct in WooCommerce?
No. Direct means WooCommerce captured the visit and it had no referrer or UTM tags. Unknown means no attribution data was saved on the order at all.
What share of Unknown orders is normal?
There's no published benchmark, and it depends on your audience and consent setup. Measure your own share month by month: a steady share is a baseline, and a sudden jump means something changed on your site.
Why do orders I create in admin not show as Unknown?
WooCommerce marks orders created in WordPress admin with the source type admin, which shows as Web admin. They have no device or UTM data, but they aren't Unknown.
See how Askshelf handles this: Order attribution reports for WooCommerce