• Resolved Greendroid

    (@greendroid)


    Hi,

    thanks for the awesome shop plugin. We have recently added it to out page and are close to the official launch.

    For this I am updating the information in our Cookie banner to reflect the Cookies set by WooCommerce.
    I used the following webpage to get a summary over all WooCommerce cookies: https://woo.com/document/woocommerce-cookies/

    I would categorize “woocommerce_cart_hash”, “woocommerce_items_in_cart” and “wp_woocommerce_session_” as a necessary cookie which can be set without consent. The “woocommerce_recently_viewed” I would categorize as optional “advertisment”-cookie. The “store_notice[notice id]” I would categorize as optional functional cookie.

    For the functional and advertisement cookie I require a consent of the user within my Cookie Banner (CookieYes) as I am based in germany.

    I have the possibility to block scripts in my cookie banner (CookieYes) in case the user has not consent to the respective cookie which is also used for Google analytics, etc..

    Is there any way or any script how I can block the setting of these cookies when the user has not consent to it?

    Thanks and kind regards
    Greendroid

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello greendroid,

    Thanks for contacting WooCommerce support and for your kind words about our shop plugin! We’re delighted to hear that you’re gearing up for your official launch and are conscientiously updating your cookie banner to comply with regulations.

    You’ve done an excellent job categorizing the cookies based on their purpose and the requirements for consent, especially considering the strict data protection laws in Germany.

    Regarding the capability to block specific cookies such as woocommerce_recently_viewed and store_notice[notice id] pending user consent, WooCommerce itself doesn’t provide a built-in feature to manage cookie consent. However, the good news is that you can indeed control cookie behavior with third-party plugins like CookieYes, which you’re already using.

    Cookie consent plugins typically offer the functionality to hook into your site’s scripts and block them from executing until the visitor has given their consent. Since each cookie consent plugin can implement this feature differently, I would recommend checking the documentation or support resources of CookieYes to understand the best way to implement cookie blocking for WooCommerce-related cookies.

    Here is a useful guide about setting up CookieYes with WooCommerce: https://www.cookieyes.com/blog/towards-making-your-woocommerce-store-gdpr-ready/

    If there’s anything more specific you would like to know feel free to let us know. We are here to assist you through the process to ensure your WooCommerce store is compliant and ready for a successful launch.

    Have a great day !

    Thread Starter Greendroid

    (@greendroid)

    Hi Zubair,

    thanks for your quick response. I have already checked this cookieyes link upfront, but unfortunately no further details are provided how to block specific cookies if the user has not consent.

    I just searched around a little bit in the further documentation of CookieYes and can see, that you can indeed block scripts there. For example for Google Analytics the following pattern is added for blocking:
    “google-analytics.com|googletagmanager.com/gtag/js”

    As WooCommerce is not opening external sites I would expect, that I can simply add the JS name of the underlying script which sets the cookie.

    Is there any dedicated JS which sets the cookie when I open the site? Then I would just try out to set it to the block list to see if it shows up further.

    Thanks and kind regards
    Greendroid

    Thread Starter Greendroid

    (@greendroid)

    Hi again,

    I have just seen, that Stripe as default payment method in WooPayments sets also two Cookies “__stripe_mid” and “__stripe_sid”.
    The internet says, that this is used for fraud protection and is necessary to enable credit card transactions.
    So I think they need to be categorized as “Necessary” cookie and do not need a further consent or what do you mean?

    Kind regards
    Greendroid

    Saif

    (@babylon1999)

    Hello @greendroid,

    I just searched around a little bit in the further documentation of CookieYes and can see, that you can indeed block scripts there. For example for Google Analytics the following pattern is added for blocking:

    Here’s another option you can explore: https://www.consentmanager.net/cookie-banner-plugin/woocommerce/

    For any questions or concerns about blocking a specific cookie, it’s best to contact the support teams of these plugins, as we’re unable to provide assistance for third-party solutions.

    So I think they need to be categorized as “Necessary” cookie and do not need a further consent or what do you mean?

    These are indeed for fraud protection and are generally required for WooPayments to work. However, in a legal context, they might not be categorised as necessary. I suggest consulting with a lawyer about this to confirm.

    Let us know if you have any other questions!

    Thread Starter Greendroid

    (@greendroid)

    Hi Saif,

    regarding the __stripe_mid and __stripe_sid I searched and informed me more within the last hours. I have found a lot of websites and also information article, that these are necessary cookies so that the website can work functional as intended. So no consent seems to be required.

    Regarding?woocommerce_recently_viewed?and?store_notice[notice id] I would need to have the dedicated JS file/path which sets the cookie. Then I know how to block that properly with my cookie banner.
    Is this an information you can provide?

    Thanks and kind regards
    Greendroid

    Plugin Support ckadenge (woo-hc)

    (@ckadenge)

    Hi there @greendroid,

    Is this an information you can provide?

    Thank you again for reaching out!

    Unfortunately, we don’t have a specific JS file/path that sets these cookies, as they are part of the WooCommerce core files.

    However, to block them, you would need to customize your WooCommerce plugin, which may require the assistance of a developer.

    Please remember that any changes to the WooCommerce core files may affect the functionality of your WooCommerce store, and these changes may be overwritten during future updates of the plugin.

    With that said, I also suggest reaching out to a developer, as this involves custom coding and implementations. The WooCommerce community is filled with talented open-source developers, and many of them are active on the channels listed below:

    Hope this helps!

    Thread Starter Greendroid

    (@greendroid)

    Hi ckadenge,

    thanks for your quick answer.
    If there is no dedicated JS file/path which sets the cookie actively I am not able to block this with my Cookie banner unfortunately.

    Customizing the plugin is not an option, as I am missing the knowledge there.

    I further searched around on other websites running a WooCommerce shop in germany. They are always adding these both cookies to the “Necessary” part with no dedicated consent. Hm… if this is the right option? I doubt that… But maybe I’m just worrying too much ??

    Thanks for now, I’ll mark this thread here as resolved as I think we are not coming further here.
    Kind regards
    Greendroid

    I believe you can set the Script URL pattern to plugins/woocommerce.

    Thread Starter Greendroid

    (@greendroid)

    Hi bekahmcdonald,

    thanks for your help. If I set the script URL to plugins/woocommerce I would expect, that all cookies are blocked. Also the cart-hash and the shop-session. I just want to block specific cookies (which are, from my opinion, not necessary/functional).

    Do you have also an idea how to block just specific cookies as mentioned above?

    Kind regards
    Greendroid

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Block Cookie if user has not consent’ is closed to new replies.