Blog

Latest News, Updates, Tutorials and much more

Automatic third-party cookies blocking

Third-party cookies in a nutshell

Third-party cookies are important for many technologies across the web. You can read the detailed explanation about how third-party cookies work.

However, sometimes they need to be blocked to comply with the latest privacy regulations. This might be a tricky task depending on what third-party services are used on your website and how the website is built. Blocking third-party cookies requires blocking whole third-party functionality and related scripts.

Why use automatic third-party cookies blocking?

Cookie-Script already has an option to block third-party cookies, but the third-party script had to be edited in order for the third-party cookies to be blocked properly. While this is a straightforward task for web developers, it might be challenging for other people since it requires actual code editing.

In some cases, it's also quite inconvenient to edit third-party scripts due to the lack of access to the script itself. Some third-party scripts are inserted using plugins, which cannot be edited to keep them updatable.

Cookie-Script now uses some advanced technologies that allow blocking any third-party scripts without editing actual third-party script code. You heard it right, you can block any third-party script, even your custom scripts. This allows your website to be compliant with third-party cookie regulations much more easily and without changing your website code.

Such functionalities help Cookie-Script to stand out from other competitors.

How does it work under the hood?

Scanning

First things first. During the scanning process, Cookie Scanner also looks for all scripts used on your website. The Cookie Scanner is smart enough to distinguish similar scripts from unique ones and treats similar scripts as one script.

Categorizing

All scripts found during the scanning process are then listed in your Banners Settings > Scripts. Here you can choose what scripts should be blocked by Cookie-Script until the user agrees to a certain category of cookies.

Blocking

Now back to your website. Here Cookie-Script banner is loaded and starts looking through other third-party scripts. At this point banner "knows" what scripts should be blocked before it gets loaded. When such a script is found, the type for the script is changed and the script is not loaded/executed.

In order for this to work properly, Cookie-Script code should be included before third-party scripts that should be blocked automatically. Ideally, Cookie-Script should be the first script included on the website

Enabling automatic third-party cookie blocking is quite straightforward:

  • Go to editing your Cookie Banner Item and select the Scripts section.
  • Find a script that sets third-party cookies, for example, the Facebook Pixel script.
  • Choose a Cookie Category after accepting which script should be activated (Let's say Targeting category). Mark script to be blocked and save your changes.

Easy as that. Your Facebook Pixel script will now be deactivated until the user agrees to the Targeting Cookies. Not a single line of code needs to be edited.

Google Tag Manager

If you are using Google Tag Manager to include scripts on your website, you should use Google Tag Manager to block third-party scripts. Automatic script blocking will not work with Google Tag Manager since Google Tag Manager itself is a system to manage scripts without editing website code.

Things to remember

There are few requirements for Automatic Third-party Cookie Blocking to work properly:

  • Cookie-Script-generated code must come before any other script that should be blocked. Otherwise, it won't be able to block those scripts.
  • The whole functionality should be enabled in settings, it can be found in the [Scripts] section of your banner.
  • You might need to re-scan your website in the case the last scan was completed before this functionality was introduced.

This feature is available in selected pricing plans. See our Pricing plans for more details.

New to CookieScript?

CookieScript helps to make the website ePrivacy and GDPR compliant.

We have all the necessary tools to comply with the latest privacy policy regulations: third-party script management, consent recording, monthly website scans, automatic cookie categorization, cookie declaration automatic update, translations to 34 languages, and much more.