Faq How can show a placeholder for a custom blocked element?
How can show a placeholder for a custom blocked element?

When using the block for third-party cookies and domains, it could be the case that certain elements of the website won't be shown anymore, being blocked until a user doesn't accept cookies.
This may be the case for example of Youtube videos, Google Maps, etc.
Rather than simply blocking and removing those elements on a page, you can choose to optionally replace them with a placeholder element indicating to the visitor that the element requires a consent in order to be shown.

screen placeholder backend

Based on the element that you want to block and replace with a placeholder, it could be required to specify additional settings for the tags list to block, indeed by default only iframes are subject to be replaced with a placeholder.

Let's say you need to block a certain HTML element like a 'div' that shows a Google Map, an OpenStreetMap, etc and replace it with the placeholder. These elements could have been disappeared because their script is actually blocked.

To do this, open the GDPR settings and configure it so that:

  1. The 'Blocking mode for third-party cookies' is set to 'Advanced' or 'Simple by tag'
  2. In the 'Tags list to block' include the tag that must be blocked and replaced
  3. In the 'Custom attribute for blocked tags' add the attribute that must match a domain string
  4. In the 'Third-party cookies domains' includes a string value that must match the attribute

In the example below, it's required to block and replace with the placeholder a 'div' element having the 'id' attribute with the value 'gmap' or 'openstreetmap':

<div id="gmap"></div> or <div id="openstreetmap"></div>

To achieve this, specify settings as in the screenshot below: blocking the 'div' tag, based on the 'id' attribute, with a value contained in the list of domains to block. Keep in mind that if you use categories, these values must also be added to the list of blocked domains for the desired category that you want to block and show the placeholder for the element.

screen placeholder frontend