Third-party cookies in a nutshell
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.
How does it work under the hood?
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.
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.
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.
How to block existing third-party scripts using Cookie-Script?
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.
- 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 case last scan was completed before this functionality was introduced.