• Dear Community,

    I′m very happy about the plugin, as it′s making the GDPR-world more comfortable. In my blog eindruecke.achmnt.eu I′m using third party content.

    VG Wort
    In order to get remunerations by the german collecting society VG Wort, you have to insert a statistic pixel image.

    e.g. https://eindruecke.achmnt.eu/2022/07/15939/

    
    <noscript>
    
    <img src="https://vg04.met.vgwort.de/na/8eb1420ae6be477cbd1e0b975f9c1043" width="1" height="1" alt="" />
    
    </noscript>
    
    <div id="wpvgw-marker" data-src="https://vg04.met.vgwort.de/na/8eb1420ae6be477cbd1e0b975f9c1043" style="display:none;"></div>
    

    I want to block the URL “vg04.met.vgwort.de” by using the Script Center. I entered the URL in “Block a script, iframe or plugin” > “URLs that should be blocked before consent”

    But it doesn′t work.

    Am I missing sth?

    Thx
    Andreas

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Andreas C. Hofmann

    (@airwolf64)

    Addition:
    I now realized, that I have to enter a complete URL and not only a domain/subdomain. Is it possible to use wildcards oder regex?

    Plugin Contributor jarnovos

    (@jarnovos)

    Hi @airwolf64,

    Using the entire URL might be a bit too specific, so instead you could enter a part of the URL and it will also be blocked, such as “vg04.met.vgwort.de” or just “vgwort” to block all scripts containing that term.

    But looking at the attached example, in this case it seems to concern a tracking pixel/image that needs to be blocked. The “block a script/iframe” field in the Script Center doesn’t target images, so I suspect you’d have use a filter such as in the below example to block this pixel prior to consent.

    <?php
    /**
    * Block images if these are from a remote third party, which is tracking user data
    */
    
    defined( 'ABSPATH' ) or die( "you do not have access to this page!" );
    
    /**
    * Block the image
    *
    * @param $tags
    *
    * @return array
    */
    
    function cmplz_block_image_sources( $tags ) {
    	$tags[] = 'vg04.met.vgwort.de';
    
    	return $tags;
    }
    add_filter( 'cmplz_image_tags', 'cmplz_block_image_sources' );
    

    You can place this filter as a .PHP file in the folder /wp-content/mu-plugins/ for it to take effect. This article provides further instructions on how to do so.

    Hope it helps!
    Kind regards,
    Jarno

    Plugin Contributor jarnovos

    (@jarnovos)

    Hi @airwolf64,

    I’ve marked the thread as resolved as I expect that following the above instructions will be sufficient to block the ‘vgwort’ tracking pixel on your website.

    Though if you do require any further assistance with this, please feel free to let us know.

    Kind regards,
    Jarno

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Blocking URL by using script center’ is closed to new replies.