Cookie Consent Manager Pro - Cookie Auto-Block Setup Guide

Version: 1.3

Last Updated: June 15, 2026

Introduction

Under GDPR regulations, consent is required for the collection of personal data. Third party technologies collecting personal data should be blocked if they do not fall under the category of strictly necessary, until the user has given consent to the use of it.

If the user has given no prior consent or chooses to reject the use of third party technologies that are not strictly necessary/Required, then Auto-block can be used to block them so personal data is not collected on the user.

While cookies and other tracking technologies can be used to identify users, and can exist on websites, Cookie Consent Manager's Auto-block can be used to block the tags so the underlying technology cannot make use of these trackers, thereby preventing collection of personal data without approval. The CCM Auto-block feature supports blocking of script, iframe, and img tags.

In cases where these tag types: script, iframe, and img, do not have an src attribute, a Manual Block Implementation is provided to allow our customers to identify and add these other tags to the Auto-block functionality.

The following sections in this document provide the steps on how to set up the Auto-block feature.

User Flow

Below is a user flow chart based on how Auto-block works. Upon initial load, the Auto-block feature identifies whether a 1st Party or 3rd Party Tag is set for Manual Block or Auto-block. Here's how it works:

The next sections of this guide outline the steps on how to set up the Auto-block feature and validate its intended function.

Auto-block Implementation

This section covers the steps on how to set up the Auto-block feature for a customer's domain.

Setting Up Auto-block Script Tag

To set up Auto-block, follow these steps:

1
Place the following scripts directly after the <head> tag of your website. Ensure that these are placed before any other script. Place the following code into all sites of your website.

core.min.js – This script contains the auto-blocking core functionalities which can block script, img, and iframe tags from being executed or loaded. This script must be placed before blocklist.min.js.

<script src="https://consent.trustarc.com/v2/autoblockasset/core.min.js?cmId=<CM_ID></script>

blocklist.min.js – This script contains the customer's list of categories and domains. Once this script is loaded, it will kickstart the process of auto-blocking.

<script src="https://consent.trustarc.com/v2/autoblock?cmId=<CM_ID></script>
📋 NOTE
If the Enable Dynamic Tracker Display feature is enabled in step 1 of the Cookie Consent Manager creation process, you have two options to kickstart the process of auto-blocking.

Option 1 - Call the blocklist directly. The fullURL parameter is OPTIONAL. This parameter is only needed if the referer header does not match the site needed.

<script src="https://consent.trustarc.com/v2/autoblock?cmId=<CM_ID>&fullURL=<FULL_URL>"></script>

Option 2 - This option is only needed if the referer header does not match the needed site and fullURL needs to be the URL of the current page.

<script>
    const fullurl = window.location.href;
    document.write(`<script src="https://consent.trustarc.com/v2/autoblock?cmId=<CM_ID>&fullURL=${fullurl}"><\/script>`);
</script>

Example:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Cookie Auto Blocker Test Page</title>

  <!-- This script tag will NOT be detected by the auto-blocker -->
  <script></script>

  <script src="https://consent.trustarc.com/v2/autoblockasset/core.min.js?cmId=cakidv"></script>
  <script src="https://consent.trustarc.com/v2/autoblock?cmId=cakidv"></script>

  <script
    type="text/javascript"
    asysnc="async"
    src="https://consent.trustarc.com/v2/notice/cakidv"></script>

  <!-- This script tag will be detected by the auto-blocker and will be checked if it needs to be blocked -->
  <script></script>
</head>

<body>
<div id="teconsent"></div>
<div id="consent-banner"></div>
</body>
</html>
📋 NOTE
An ipaddress parameter can be added for testing purposes to mimic behavior from certain geolocations. Add &ipaddress=<ipaddress> to the end of the Consent Manager tags. Without this parameter, usual automatic geolocation will be implemented.
2
Enable the Auto-block feature for your domain in the CCM Portal.
a

From the left side of the page, hover the mouse over the Cookie Consent Manager icon (1), and then click Scans and Consent (2).

b

Open the cookie consent manager. In Step 3. Configure Consent Manager step (3), select the Enable Auto-block (4) checkbox to enable the feature. For more information about this feature, hover over the tooltip.

3
You can also disable or enable the auto-block feature per region, country, or state.
a

From step 3, go to the Location Settings, click the Edit icon to the right of the region/country/state.

b

From the Update Location Setting modal, go to the General Settings (5) tab, and then click Auto-block to show more details.

Then, click the Execute "Auto-block" (6) checkbox to enable the feature for the selected region, country, or state. You can also configure which Cookie Category to always fire by default by clicking the Cookie Category checkbox (7). Note that Required Cookies will always fire.

4
The auto-block feature will read the tracker categorizations from the Consent Manager setup. Please ensure that this categorization is completed and kept up to date. The blocklist.min.js file will determine which tags to block based on where tags are categorized and what consent the user gave.
5
Wait for about an hour for the CCM application to cache your setting changes. Your webpage should be ready once the recaching is complete.
Manual Block Implementation

This section covers the steps on how to set up the Manual block feature for your domain.

Setting Up Manual Blocking of Script Tag

This feature was provided to allow the customers the additional option to block tags whether or not the tags have an src attribute in the declaration.

In order to manually block a tag with src, set the script type of the tag script to ta-blocked. This only blocks scripts that you select to be blocked and suspends the load of the tag on your website until consent is given. Note that this script should be placed below the Auto-block script.

<!-- This is a manually blocked script tag with src and will not be executed until the user opts-in for the domain google.com -->
<script type="ta-blocked" src="https://google.com/script.js"></script>

<!-- This is a manually blocked script tag without src and will not be executed until the user submits a consent -->
<script type="ta-blocked"></script>

NOTES:

•  If auto-block is disabled, manually blocked script tags will follow the natural behavior of the browser.

•  For script tag, type="ta-blocked" will cause the browser to block the script as detailed here. "The embedded content is treated as a data block, and won't be processed by the browser."
•  img and iframe are not supported for manual blocking. Type is not a valid attribute and will only be ignored.
Manually Blocking a Script Tag with a Domain

If you want to set a domain for a script tag that has no src attribute so that it can be unblocked if the user opts-in for that domain, then set the domain to the attribute data-ta-domain. Note that this script should be placed below the Auto-block script.

<!-- This is a manually blocked script tag with a domain and will not be executed until the user opts-in for the domain; for example, google.com -->
<script type="ta-blocked" data-ta-domain="google.com">
  // some code here
</script>
Page Reload to Block Tags

Auto-block can automatically unblock tags when a user consents, but a page reload is needed to block tags.

⚠ Compliance Disclaimer
A page reload may be required for compliance to ensure that tags, which should be blocked after an opt-out, do not continue to collect personal data from the user.

Page reload after submitting consent choice from Modal window and Banner

Include the following script along with your CCM script to induce a page reload when the customer opts out via the modal popup window or from the cookie banner. This can reside in the HEAD tag or can be loaded via a tag manager.

<script>
window.addEventListener("message", function(event) {
    var eventDataJson = null;

    // We only care about TrustArc Events at this point. And TrustArc's even it encoded in JSON
    try {
        eventDataJson = JSON.parse(event.data);
    } catch (e) {
        // Some other event that is not JSON.
        // TrustArc encodes the data as JSON
        // console.log(event.data);
    }

    // Safeguard to make sure we are only getting events from TrustArc
    if (eventDataJson && eventDataJson.source === "preference_manager") {
        // Means that the user has submited their preferences
        if (eventDataJson.message === "submit_preferences") {
            setTimeout(function() {
                window.location.reload();
            }, 20);
        }
    }
}, false);
</script>
Ignore Tags for Autoblock

You can mark tags managed by Google Tag Manager as "ignored" so that the autoblock feature does not block them.

Add data-ta-type="ignore" to ignore a script, img, or iframe. The ignored tags will not be processed by autoblock.

<script data-ta-type="ignore" src="https://google.com/script.js"</script>

Limitations

•  document.createElement('img'), document.createElement('iframe'), and new Image() are not supported.
•  Tags that are called/created inside an ignored script will not be ignored.
Suppressing Autoblock Verbose Messages

This implementation is to provide an option to suppress verbose messages, enabling more efficient logging during production or in less critical environments. A mechanism is created where verbose logging only occurs when a specific flag is set in the localStorage. This flag can be set manually by the client or Technical Account Managers (TAMs) when they want to enable detailed Autoblock logs.

Enabling Verbose Logging

Clients or TAMs can enable verbose logging by manually setting the flag in the console. To do this, use the following command:

localStorage.setItem('autoblock:debug', 'true');
Validation

This section covers the steps on how to validate the Auto-block feature functions as intended.

Verifying Auto-block Works

To ensure that the tags are blocked after Auto-block is configured for your domain, follow these steps.

1
Load your website after clearing all the current cookies on the browser.
2
If you are using Google Chrome, right-click on the page and choose Inspect. This opens the Developer Console.
3
In the Network tab, check that the below 2 files have been called:
•  core.min.js?cmId=<CM_ID>&ipaddress=<IPADDRESS>
•  autoblock?cmId=<CM_ID>&ipaddress=<IPADDRESS>
4
Click the Console and enter the code localStorage.setItem('autoblock:debug', 'true'); tab to review which tags are blocked. The Console tab logs messages of what tags are blocked and unblocked.

Blocked Tags

Unblocked Tags

5
In the Elements tab, a data-ta-blocked attribute is displayed. If data-ta-blocked="1", this indicates that the tag is blocked. If data-ta-blocked="0", this indicates that the tag is unblocked.

•  For script tag, the type is set to "ta-blocked".

Example:

<script src="https://google.com/script.js" type="ta-blocked" data-ta-blocked="1"></script>

•  For img tag, the actual src of the image is set to data-ta-src and the src will be empty.

Example:

<img src="" data-ta-src="https://google.com/image.png" data-ta-blocked="1" />

•  For iframe tag, the actual src of the image is set to data-ta-src and the src will be empty. The srcdoc is also set to "<div></div>".

Example:

<iframe src="" srcdoc="<div></div>" data-ta-src="https://google.com/iframe.html" data-ta-blocked="1"></iframe>
6
You can also check the UI which tags are blocked or unblocked. Upon first load, the tags should not be displayed on the page, except for Required Cookies tags. The Required tags are loaded because trackers under Required Cookies should not be blocked.

If a user opts in to Functional Cookies or Advertising Cookies, then tags for these cookies should be unblocked or fired immediately. If a user opts out of Functional Cookies or Advertising Cookies, the tags will be blocked after the page is reloaded/refreshed.

Please refer to the User Flow section to see the complete control flow for testing purposes.

Limitations

Below are some of the known limitations of the Auto-block feature.

•  Auto-block has been tested to work as a standalone feature. We will verify its compatibility with existing Tag Management solutions and deployments in our future releases.
•  Auto-block currently does not support the feature "deploy unique consent managers on the same root domain". Auto-block will recognize the consent from the root domain level and block tags. We will support this feature in a future release.
•  Auto-block can only work if the Auto-block script is placed inside the <head> tag of the website code. If it is installed under any other script, img, or iframe, the above script, img, or iframe cannot be blocked before loading.
•  Auto-block code currently only identifies 3rd party tags of type script, img, or iframe.
•  Auto-block only works with modern browsers (Chrome v.70+, IE 11, Edge 42+, Firefox v.60+, Safari v.11+).
•  In certain scenarios, JS files will still be downloaded and will have a 200 status in the network (but it will not get executed). Cookies set via header of these calls are not able to be intercepted. Please use manual block in this case.

•  If a tag/tracker is listed in 2 buckets and one bucket selects opted-in for that exact tracker, then the default would be opted-in for all categories. It must be an exact match for this scenario to occur.

For example:

A user provides consent for Functional Cookies, but opts out of Advertising Cookies.

linkedin.com is in Functional bucket, opted-in.
linkedin.com is in the Advertising bucket, opted-out.
ads.linkedin.com is in the Advertising bucket, opted-out.

linkedin.com will be opted-in because it has been double-listed.
ads.linkedin.com is opted out because it is single listed in the Advertising bucket and will adhere to the opted-out consent.

The CCM UI will reflect opted-in for linkedin.com (Functional bucket is opted-in if you only list bucket opt-outs) and opted-out for Advertising bucket.

TrustArc Trust Center  ·  CCM Auto-block Deployment Guide  ·  support.trustarc.com