How to use manual blocking with cookies and trackers


By Manish Gautam

updated about 2 months ago

Secure Privacy offers two types of blocking mechanisms: 1) Automated blocking and 2) Manual blocking. In this article, we'll explain you how to set up manual blocking. Information about the automated blocking can be accessed here.

To block cookies and trackers you need to change the attributes of the script tags on your website. Follow these steps to change the attributes.

  1. Apply the attribute sp-consent="PLUGIN NAME" to the script/image tags on your website. Depending on where you have installed the plugins, this may be inside a module, plugin or directly on your website. Make sure that you write the exact plugin name, which appears on your Scan Report.
  2. On script tags change the attribute 'type' from 'text/javascript' to 'text/plain'.  
  3. If you are using a pixel tracker (image trackers), then change the attribute “src” from “src” to “data-src”.

Here is an example of how it would look after you have modified a Google Analytics script.

Normal script tags look like this:

<script type="text/javascript">

Using script type re-writing, you need to change the scripts to:

<script type="text/plain" sp-consent="Google Analytics">


Did this answer your question?