Home > Docs > GDPR Cookie Consent > How to Allow Specific Scripts to Load Before User Consent

How to Allow Specific Scripts to Load Before User Consent

Last updated on April 24, 2026

If the GDPR Cookie Consent plugin by WebToffee blocks certain scripts on your website, it’s likely because the plugin’s automatic script blocking feature has detected that those scripts may set cookies prior to user consent. To maintain GDPR compliance, these scripts are prevented from running until a visitor has given their explicit consent for the associated cookie categories.

However, there may be instances where you want a script to run regardless of consent, while still ensuring that it does not set cookies until consent is obtained. This typically happens when the script does not store any cookies before the user acts (for example, a chat widget that only stores cookies when the user opens it).

In such cases, you can exclude specific scripts from automatic blocking by adding a simple attribute data-wcc="necessary" ,to the script tag.

Use Case

You’re using a third-party live chat tool that doesn’t set cookies until a visitor starts a chat. The GDPR Cookie Consent plugin’s scanner identifies this as a cookie-setting script and blocks it by default. This prevents the chat widget from appearing on page load.

By adding data-wcc="necessary" to the chat script, you allow the widget to load while maintaining compliance, since the chat tool itself doesn’t store cookies until the user interacts with it.

Best practices

  • Periodically audit excluded scripts to maintain compliance.
  • Keep a record of which scripts are manually exempted from automatic blocking.
  • Test cookie behavior using your browser’s developer tools before and after user consent.
  • Do not use this attribute arbitrarily. Any script marked with data-wcc="necessary" can execute before user consent is obtained, which means it could potentially set cookies or perform tracking outside of compliance.