Skip to content
WooCommerce

Cookie consent on WooCommerceCart cookies are fine, order attribution is on by default

Reviewed · 4 sources

A WooCommerce shop sets cookies for the cart and the session. Those are needed to provide the shop the customer is using, so they do not need consent, though they belong in your cookie policy.

Since version 8.5, WooCommerce also ships order attribution, which records where each visitor came from. It is enabled by default and its scripts load for every front-end visitor. WooCommerce itself wrote that EU merchants may have become non-compliant as a result.

Check your WooCommerce site

See every cookie it sets before consent, after Reject and after Accept.

What WooCommerce setsOn its own

  • woocommerce_cart_hashSession cookie. Helps WooCommerce know when the cart contents change.No consent needed
  • woocommerce_items_in_cartSession cookie. Marks that the cart has items.No consent needed
  • wp_woocommerce_session_*Two days. A unique code per customer so the shop finds their cart data.No consent needed
  • woocommerce_recently_viewedSession cookie. Powers the Recently Viewed Products widget.Consent required
  • store_notice[id]Session cookie. Remembers that the visitor dismissed the store notice.No consent needed
  • sbjs_*Order attribution (Sourcebuster): sbjs_session, sbjs_udata, sbjs_first, sbjs_current, sbjs_first_add, sbjs_current_add, sbjs_migrations. Traffic source, campaign and device data.Consent required

Names and lifetimes from WooCommerce's documentation. Whether a cookie needs consent is our assessment: the recently-viewed cookie is a convenience feature rather than something the shopper asked for, and the attribution cookies record marketing data.

Built-in consent tools

No banner, an optional link to WP Consent API

WooCommerce has no cookie banner of its own. Like the rest of WordPress it relies on a consent plugin.

Order attribution is compatible with the WP Consent API plugin and uses the marketing category. That link only does something when WP Consent API is installed together with a consent plugin that sets the categories. Without them, attribution tracks every visitor.

Where the cookies come fromThe ones that need consent

Order attribution

On by default since WooCommerce 8.5. Sets the sbjs_* cookies for all visitors. Turn it off under WooCommerce > Settings > Advanced > Features > Order Attribution, or gate it on marketing consent.

Google and Meta extensions

Google for WooCommerce, Meta for WooCommerce and similar extensions add ad and analytics tags to every shop page, including product and checkout pages.

Payment and fraud scripts

Payment gateways load their own scripts and set their own cookies on the checkout. Those used to take the payment are necessary; anything used for advertising is not.

Email and review tools

Abandoned-cart, pop-up and review widgets usually identify the visitor across visits. Treat them as marketing unless the vendor documents otherwise.

Make WooCommerce compliantIn 5 steps

  1. 1

    Decide on order attribution

    If you do not use the attribution reports, switch the feature off. If you do, install WP Consent API and a consent plugin so the sbjs cookies wait for marketing consent.

  2. 2

    Gate the marketing extensions

    Make sure your consent plugin blocks the Google and Meta tags before consent on every template, including cart and checkout.

  3. 3

    Leave the cart alone

    Do not block the cart and session cookies. A shop that cannot keep a cart without consent is broken, and consent for these cookies is not required.

  4. 4

    List everything in the cookie policy

    Include the necessary cookies too: name, purpose, provider and lifetime for each.

  5. 5

    Test a full purchase after Reject

    Reject cookies, add a product, check out. The order must go through and no sbjs_, _ga or _fbp cookie may appear.

Keep order attribution off until marketing consent
// WooCommerce does this itself when the WP Consent API plugin is active.
// Use the filter directly if you manage consent another way.
add_filter( 'wc_order_attribution_allow_tracking', function () {
    return function_exists( 'wp_has_consent' ) && wp_has_consent( 'marketing' );
} );

The filter defaults to true: with nothing connected, tracking is on for everyone.

Tools that help: tracking script blocker · Consent Mode v2 generator · cookie reference

Common mistakesOn WooCommerce sites

Assuming a WooCommerce update changes nothing

Order attribution arrived switched on in a regular update. Scan again after major releases.

Blocking the cart cookies

Some consent plugins put every WooCommerce cookie under one toggle. Rejecting then empties the cart.

Tags that fire only on checkout

A homepage test misses conversion pixels that load on the cart, checkout and thank-you pages.

A policy copied from a template

It lists the WordPress cookies and misses the sbjs_ and extension cookies your shop really sets.

Checklist for WooCommerce sites

  • Order attribution switched off, or gated on marketing consent
  • Cart and session cookies work after Reject
  • No ad or analytics tag before consent on product, cart and checkout pages
  • Payment gateway cookies documented in the policy
  • Email, pop-up and review widgets categorised in the consent plugin
  • Re-scan after each WooCommerce or extension update

QuestionsAnd short answers

Do WooCommerce cart cookies need consent?
No. Cookies that are strictly necessary to provide a service the user asked for are exempt under the ePrivacy Directive, and a shopping cart is the standard example. They still have to be listed in your cookie policy.
What are the sbjs_ cookies?
They belong to Sourcebuster, the library behind WooCommerce order attribution. They store the visitor's traffic source, campaign parameters, first and current visit, and device details.
Does WooCommerce order attribution respect consent?
Only if the WP Consent API plugin and a consent plugin are installed. WooCommerce then ties attribution to the marketing category. Otherwise it runs for every visitor.
How do I turn order attribution off?
Go to WooCommerce > Settings > Advanced > Features and untick Order Attribution.

Sources

  1. WooCommerce Cookies
  2. WooCommerce: Order Attribution Tracking
  3. WooCommerce 8.5: Addressing Concerns and Commitment to Improvement
  4. WP Consent API plugin

Reviewed 20 November 2026 against WooCommerce's own documentation. Platforms change their cookies and consent features; follow the links for the current state. General information about EU cookie rules, not legal advice.

Other platformsAnd guides by industry

Check your WooCommerce siteSee what loads before consent

Free scan · every cookie before consent, after Reject and after Accept