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.
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:
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.
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:
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.<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.
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.
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):
<script data-cmp-ab="1">
window.cmp_block_ignoredomains.push("microapps.bigcommerce.com", "cdn11.bigcommerce.com", "checkout-sdk.bigcommerce.com");
</script>
<script data-cmp-ab="1">
window.cmp_block_ignoredomains.push("assets.squarespace.com");
</script>
<script data-cmp-ab="1">
window.cmp_block_ignoredomains.push("softr-prod.imgix.net");
</script>
<script data-cmp-ab="1">
window.cmp_block_ignoredomains.push("static.cdn-website.com");
</script>
<script data-cmp-ab="1">
window.cmp_block_ignoredomains.push("api.clerk.io","cdn.clerk.io");
</script>
If you’re experiencing issues with HubSpot Forms not being released after consent with autoblocking, consider the following solutions:
reloadOnConsent: true
to reload the page after consent is given.<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>
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:
<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.