Iubenda logo
Start generating

Documentation

Table of Contents

What to Do When the Automatic Blocking Mode is Blocking Too Much

Automatic blocking mode is a powerful feature designed to support privacy compliance by automatically blocking certain scripts, cookies, or tracking technologies until user consent is obtained. However, in some cases, it might block more than necessary, leading to issues for users. This guide will help you troubleshoot and adjust the settings to better suit your needs.

Note: Some advanced features mentioned in this guide, including manual whitelisting, blocking inline scripts, and addressing specific use cases, are available exclusively to Ultimate plan users.

🚀 Upgrade your iubenda plan now →

Excluding scripts, iframes, and domains from automatic blocking

Whitelist via auto-blocking settings

If certain domains need to be exempted/whitelisted from automatic blocking, you can do so by utilizing the iubenda settings.

Once the site/project is selected in the “Dashboard“, click on the Settings icon located in the site info panel:

cookie audit tool

Next, in the tab: “Block scripts prior to consent“, you will find the configuration option for Automatic blocking. Scroll down and enable the “Ignore specific domains” toggle. Next, select “Add domain”, and type in the URL you want to exclude.

cookie audit tool

Whitelist manually

In some situations, you may need to exempt a script or an iframe from automatic blocking. To whitelist it, you’ll need to insert specific attributes into the script or iframe code and then add them directly to the source code. Here’s how you can do it:

  1. Determine which script or iframe you need to exclude from automatic blocking.
  2. Decide whether you need to use data-cmp-ab="1" or data-cmp-ab="2". The choice depends on your specific requirements:
  • data-cmp-ab="1": When you include data-cmp-ab="1" in the script or iframe code, it signifies that iubenda will refrain from using automatic blocking solely with this specific element. In other words, only the individual script or iframe tagged with this attribute will be exempt from automatic blocking.
  • data-cmp-ab="2": On the other hand, when you include data-cmp-ab="2", it indicates that iubenda will not employ automatic blocking with the designated element (<script> or <iframe>) and any other elements created by this particular element. This means that not only the tagged script or iframe, but also any subsequent elements generated by it will be excluded from automatic blocking.
  1. Once you’ve made your decision, insert the chosen attribute into the script or iframe code. For example, if you have a script tag like this:
<script src="https://example.com/script.js"></script>

You would modify it to include the data-cmp-ab attribute:

<script data-cmp-ab="2" src="https://example.com/script.js"></script>

Replace "https://example.com/script.js" or "https://example.com" with the actual URL of the script or iframe you’re excluding.

Whitelisting Domains with Specific Scripts

If you find that automatic blocking is interfering with certain scripts embedded directly within your website’s code, you can manually whitelist domains by adding a specific script. This ensures that these domains are exempt from being blocked by automatic blocking.

To whitelist domains using this method, add the following script after our Privacy Controls and Cookie Solution script in your website’s code:

<script data-cmp-ab="1">
window.cmp_block_ignoredomains.push("api.example.com", "cdn.example.com");
</script>

If you need to whitelist additional domains, simply add them to the list inside the square brackets, separated by commas.

Useful Scripts for Whitelisting Specific Platforms/Site Builders/CMS

If you’re using specific platforms, site builders, or CMS, you may encounter issues with automatic blocking mode. Here are some useful scripts to whitelist domains associated with these platforms (even if you’re already whitelisting these domains, this information can be useful):

BigCommerce

<script data-cmp-ab="1">
window.cmp_block_ignoredomains.push("microapps.bigcommerce.com", "cdn11.bigcommerce.com", "checkout-sdk.bigcommerce.com");
</script>

Squarespace

<script data-cmp-ab="1">
window.cmp_block_ignoredomains.push("assets.squarespace.com");
</script>

Softr Site Builder

<script data-cmp-ab="1">
window.cmp_block_ignoredomains.push("softr-prod.imgix.net");
</script>

Register.it Simply Site Editor – Site Builder

<script data-cmp-ab="1">
window.cmp_block_ignoredomains.push("static.cdn-website.com");
</script>

clerk.io

<script data-cmp-ab="1">
window.cmp_block_ignoredomains.push("api.clerk.io","cdn.clerk.io");
</script>

Addressing Specific Use Cases

HubSpot Forms

If you’re experiencing issues with HubSpot Forms not being released after consent with autoblocking, consider the following solutions:

  • Ensure that HubSpot scripts are correctly detected for blocking.
  • If the form is not loading after consent, you can choose between:
    • Setting reloadOnConsent: true to reload the page after consent is given.
    • Replacing the original HubSpot form snippet with the following code to load the form without reloading the page:
<script class="_iub_cs_activate-inline" type="text/plain" data-iub-purposes="5">
const script = document.createElement('script');
script.src = 'https://js.hsforms.net/forms/embed/v2.js';
script.onload = function() {
hbspt.forms.create({
region: "na1",
portalId: "your-portal-id",
formId: "your-form-id"
});
}
document.head.appendChild(script);
</script>

“Purchase” Event Missing After Enabling Autoblocking

Platform affected: WordPress
Affected plugins: GTM4WP & WooCommerce Google Analytics Integration

If you are prevented from entering the “purchase” event in the Google Tag Manager data layer after automatic blocking is enabled, try the following:

  1. Disable “Block Inline Scripts” Option:
  • If you’re encountering this issue, the first recommended solution is to disable the “Block Inline Scripts” option from the autoblocking settings.
cookie audit tool
  1. Disable Autoblocking:
  • Alternatively, if disabling “Block Inline Scripts” doesn’t resolve the issue, you can disable autoblocking altogether.
  1. Alternative Solution (For Users Without Access to Advanced Settings):
  • If you don’t have access to the “Block Inline Scripts” option due to your plan limitations, you can use the following script after implementing the Privacy Controls and Cookie Solution Script:
<script data-cmp-ab="1">
window.cmp_block_inline = false;</script>

This script ensures that inline scripts are not blocked, allowing the “purchase” event to be correctly pushed into the data layer of Google Tag Manager.

💡 Remember that changes sometimes take time to take effect, so after you have made any changes to your iubenda settings, please allow at least 30 minutes for the changes to propagate and become active on your site.

If you’re still experiencing difficulties after following the above steps, don’t hesitate to reach out to customer support for further assistance.