Integrations
WooCommerceWooCommerce
field-testedPlatforms and stores

CookiePilot for WooCommerce: cart works, trackers wait for consent

A WooCommerce store must keep working after consent is rejected. CookiePilot keeps cart cookies as necessary and starts analytics and marketing tags according to the user's choice.

Consent behaviour

Cart and checkout are not blocked by the CMP.

woocommerce_cart_hash and woocommerce_items_in_cart are treated as necessary.

Recommendation: disable WooCommerce Order Attribution if it sets sbjs_* before consent.

Setup steps

Install the CookiePilot WordPress plugin.

Enable WooCommerce-safe settings and Consent Mode default denied.

If sbjs_* cookies appear, disable WooCommerce Order Attribution or gate it behind consent.

Test product, add-to-cart, cart and checkout in a clean session.

Example snippet

Example snippet
CookiePilot.getConsent()
document.cookie.split('; ').filter(function (cookie) {
  return cookie.indexOf('woocommerce_') === 0 ||
         cookie.indexOf('wp_woocommerce_session_') === 0 ||
         cookie.indexOf('sbjs_') === 0 ||
         /(_ga|_fbp|_gcl|_ttp|_hj)/.test(cookie);
})

function () {
  var consent = window.cookiepilot_consent || {};
  return consent.marketing === true;
}

Test checklist

The product is public and add-to-cart works.

After Reject, checkout still shows the order form.

Before consent there are no Meta, TikTok, Hotjar or Google Ads requests.

After Accept, the consent update grants analytics and marketing.

Related integrations

See the setups that most often appear together with this integration.

Ready to configure it?

Start CookiePilot, choose the right integration and verify that tags wait for user consent before they run.