COOKIES. CONSENT. COMPLIANCE
secure privacy badge logo
June 23, 2019

How to block cookies and trackers with JavaScript rewrite

This guide explains you how to block cookies and plugins with Secure Privacy using Javascript rewrite.

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"> code…

</script>

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

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

</script>

image

GDPR Compliance Automation: Complete Guide & Tool Comparison

Your privacy team is drowning in manual GDPR workflows. Data subject access requests pile up for weeks. Data mapping takes months instead of minutes. Your spreadsheet-based consent records can't scale to millions of users. Meanwhile, European regulators issued €1.2 billion in GDPR fines last year alone, and your current compliance approach can't keep pace with enforcement intensity or business growth. GDPR compliance automation transforms this reality by applying intelligent technology to streamline, accelerate, and enhance the accuracy of data protection activities. Organizations implementing comprehensive automation report 85-97% reduction in compliance workloads while improving accuracy and reducing regulatory risk by up to 75%. This guide explains what GDPR compliance can be automated, which processes require human judgment, how to select automation platforms, and what ROI you can expect from intelligent privacy technology investments.

    image

    What is ad_user_data in Google Consent Mode v2 — and Why It Matters for Your Ads

    Your Google Ads conversion tracking just stopped working in Europe. Campaign performance dropped 30% overnight. Google Tag Assistant shows consent signal errors. You're seeing warnings about missing Consent Mode v2 implementation, but you're not sure what ad_user_data means or why Google suddenly requires it.

      cookie consent best practices

      Cookie Consent Best Practices: Getting your Website Compliant in 2025

      Your website just lost another potential customer. Not because of your product, pricing, or user experience — but because your cookie banner frustrated them into clicking away. Sound familiar?

      • Cookie Consent