Info
Content

AdBlocking / Postponing ad load

The CMP can postpone the load of ads on your website until consent is given. In order to enable this feature you need to change existing creative codes on your website.

Please note, that blocking / postponed loading only works with asynchronous script codes and Iframe codes.

Iframe-Codes

If you want to postpone an iframe code, please follow these steps:

  1. Change the src="…" attribute of the iframe to data-cmp-src="…"
  2. Add a new src="about:blank" attribute to the iframe
  3. If a class="…" exists, add “cmplazyload” to the value. If class does not exist, add the attribute including the value

Example code before change:

<iframe width="300" height="250" noresize="noresize" scrolling="no" 
        frameborder="0" marginheight="0" marginwidth="0"
        src="http://adserver.de/?x=1&y=2"
        ALLOWTRANSPARENCY="true"></iframe>

Example code after change:

<iframe width="300" height="250" noresize="noresize" scrolling="no"        
        frameborder="0" marginheight="0" marginwidth="0"        
        class="cmplazyload"        
        src="about:blank"        
        data-cmp-src="http://adserver.de/?x=1&y=2"        
        ALLOWTRANSPARENCY="true"></iframe>

asynchronous Script-Codes

If you want to postpone the load of an async. Script code, please follow these steps:

  1. Change the src="…" attribute of the script to data-cmp-src="…"
  2. If a class="…" exists, add “cmplazyload” to the value. If class does not exist, add the attribute including the value

Example code before change:

<ins class="asm_async_creative" style="display:inline-block; width:300px; height:250px; text-align:left;" 
     data-asm-host="ads.adspirit.net" data-asm-params="pid=395&wmid=525&nvc=1"></ins>
<script src="https://ads.adspirit.net/adasync.min.js" async type="text/javascript"></script>

Example code after change:

<ins class="asm_async_creative" style="display:inline-block; width:300px; height:250px; text-align:left;" 
     data-asm-host="ads.adspirit.net" data-asm-params="pid=395&wmid=525&nvc=1"></ins>
<script class="cmplazyload" data-cmp-src="https://ads.adspirit.net/adasync.min.js" async type="text/javascript"></script>

Additional attributes

The following additional attributes can be added to script/iframe codes in order to further align the delivery to certain consent results:

Attribut

Description

data-cmp-hide="1"

if present, CMP will hide the iframe if consent is not given and unhide the iframe if consent is given

data-cmp-vendor="x"

CMP will only activate this script/iframe if consent for vendor x is given

data-cmp-purpose="x"

CMP will only activate this script/iframe if consent for purpose x is given

 

Back to top