• Resolved Jarad

    (@jtmar12)


    Hi. I would like to confirm how to prevent the plugin from doing any kind of automatic cookie blocking. In the wizard cookie descriptions page a comment on the right says “or you can disable the cookie blocker entirely on the settings page” but I cant see on the settings page a clear setting for disabling this?

    Basically I am using the events the plugin generates to block or enable cookies entirely via Google tag manager so want the wordpress plugin to only be functional in terms of the banner and generating events for GTM and not be blocking anything directly. Hope that makes sense?

    How can I ensure this? Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor jarnovos

    (@jarnovos)

    Hi @jtmar12,

    You could use a MU Plugin such as the below to achieve this (place it as a .php file in the folder /wp-content/mu-plugins/). It will disable the automatic Cookie/Script Blocker, but leaves the Cookie Banner and GTM events active.

    <?php
    defined( 'ABSPATH' ) or die( "you do not have access to this page!" );
    
    /**
     * Disable the cookie blocker
     */
    
    function cmplz_my_filter_site_needs_cookiewarning( $cookiewarning_required) {
    	define('CMPLZ_DO_NOT_BLOCK', true);
     	$cookiewarning_required = true;
    
    	return $cookiewarning_required;
    }
    
    add_filter( 'cmplz_site_needs_cookiewarning', 'cmplz_my_filter_site_needs_cookiewarning' );

    Hope it helps!
    Kind regards,
    Jarno

    Thread Starter Jarad

    (@jtmar12)

    Thank you for this, the website manager has installed this. I am not very technical however so is there any simple way that I myself can test this to make 100% sure it was done correctly and its working? Even if its some console code I can use or anything frontend i can do to test, or I can also check in GTM preview as I manage that. Or is there an indication on the plugins settings page somewhere to confirm?

    Also not sure if I need a new request for this but we would like to set the cookie and privacy policy banner links to open in new tab but according to our website manager there is no option to allow this. Is this possible?

    Much appreciated!

    Plugin Contributor jarnovos

    (@jarnovos)

    Hi @jtmar12,

    To test if your GTM tags fire correctly, you could use a browser extension such as TagBird.

    And if the ‘disable cookie blocker’ filter works, you will find that when you visit a page of your site, open the Developer Tools in your browser and look at the <body> element; it will not contain <body data-cmplz="">.

    With the filter disabled (so, when the cookie blocker is activated), the <body> element will appear like in the below screenshot.

    We also offer a filter for the Cookie Banner links to open in a new tab, please find it attached here. Implementation can be done in the same way as described in my previous post.

    Kind regards,
    Jarno

    Thread Starter Jarad

    (@jtmar12)

    Thank you, you have been very helpful I appreciate it.

    A quick hopefully last question:

    From what I understand the toggles after manage is clicked are set in the off position automatically correct. So if they click manage and save right away it will result in proceeding with marketing and stats disabled automatically.

    Is it possible to edit the banner so that the toggles are set as “on” by default so after clicking manage the user has the option to turn them off before saving and proceeding? Or is this against policy? They still get a choice however so It shouldn’t be?

    This is a stretch but is it possible to have dynamic text next to the toggle saying on or off? With our color scheme its difficult to tell if the toggle is actually on or off, id like to make it as clear as for users possible, maybe with some text that changes with the toggle: https://ibb.co/6tfmPLR

    Thanks again, appreciate it.

    Plugin Author Aert Hulsebos

    (@aahulsebos)

    Hi @jtmar12,

    It’s indeed agains policy, you can read it here: https://complianz.io/pre-checked-categories-why-not/

    You can download a .zip on this page to enable the toggles by default, if you really want to.

    You can also change the toggle to say on/off if needed. You can use either CSS only based on the toggle being checked, or create your own banner with HTML from scratch.

    If you need some help with that, let me know I can see if I can write an article about switching toggles.

    regards Aert

    Thread Starter Jarad

    (@jtmar12)

    Much appreciated!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Prevent automatic blocking, use only gtm events’ is closed to new replies.