How to check if a cookie script is blocked

In this article, we will show you how to make sure that a cookie script has actually been blocked. We will explain this in relation to our automatic script blocker. Nevertheless, you can use the same approach for scripts rendered via any other third-party plugins or themes or even manually add via the GDPR Cookie Consent Plugin.

The GDPR Cookie Consent plugin allows you to block the scripts(that inject cookies) that are active in the website until the users give their explicit consent by clicking on the Accept button. The scripts will not be rendered on the website if users ignore the cookie bar or click on the Reject button thereby denying the consent to the use of the cookies on the website.

Refer How to Automatically Block Cookies Using the GDPR Cookie Consent Plugin to know more on it.

For instance, let us go through the steps that block the Google Tag Manager script from rendering in the website.

  1. Navigate to GDPR Cookie Consent plugin > Script Blocker.
  2. Enable Google Tag Manager from the Manage Script blocker list.
  3. Load your website(in an incognito mode/private window) without providing any consent.
  4. Right-click, view the page source and search for Google Tag Manager script. You can see that the script type value is “text/plain” which makes the script to behave like a text content without getting rendered in the website.
  5. Now, go to your website and accept the cookie.
  6. Inspect the page. You can see that the Google Tag Manager script type value has been updated from  “text/plain” to “text/javascript” from indicating that the script has been rendered on your website.

The above steps are demonstrated below:

How script is blocked using GDPR cookie consent plugin
How scripts are blocked using GDPR cookie consent plugin

Leave a Reply

Your email address will not be published. Required fields are marked *