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.

Overview

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.

Test

Cart and checkout are not blocked by the CMP.

Test

woocommerce_cart_hash and woocommerce_items_in_cart are treated as necessary.

Info

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

Consent behaviour

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.

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

Example snippet
// Browser console check after Reject on cart or checkout
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);
})

// Example GTM condition for ecommerce marketing tags
function () {
  var consent = window.cookiepilot_consent || {};
  return consent.marketing === true;
}

// Keep cart and checkout functional. Do not block these cookies:
// woocommerce_cart_hash
// woocommerce_items_in_cart
// wp_woocommerce_session_*

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.

Setup steps

  1. 1Install the CookiePilot WordPress plugin.
  2. 2Enable WooCommerce-safe settings and Consent Mode default denied.
  3. 3If sbjs_* cookies appear, disable WooCommerce Order Attribution or gate it behind consent.
  4. 4Test product, add-to-cart, cart and checkout in a clean session.

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.

FAQ

Is this legal advice?

No. It is an implementation guide. For unusual data flows, confirm the setup with your legal or privacy team.

Does CookiePilot block every script automatically?

CookiePilot supports autoblocking and Consent Mode. Trackers hardcoded before the CMP still need to be moved behind the stub or into GTM Consent Initialization.

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.