• Resolved nickfr

    (@nickfr)


    here is a workaround for gdpr plugin and facebook pixel plugin
    can i use a filter in your plugin too? like pys_disable_by_gdpr

    
    /**
     * Disable Facebook Pixel based on Cookie Consent
     *
     * This snippet disables the Facebook Pixel Tracking Code based on the specific cookie settings.
     * @link https://wordpress.org/plugins/pixelyoursite/
     * @link https://wordpress.org/plugins/gdpr-cookie-compliance/
     */
    add_action( 'after_setup_theme', 'pixel_cookie_consent' );
    
    function pixel_cookie_consent() {
    	
    	$cookie = ( isset( $_COOKIE['moove_gdpr_popup'] ) ) ? $_COOKIE['moove_gdpr_popup'] : false;
    
    	$cookie = stripslashes( $cookie );
    	$cookie = json_decode( $cookie, true );
    	
    	// disabled by default	
    	add_filter( 'pys_disable_by_gdpr', '__return_true' );
    	
    	// enabled based on user setting
    	if ( $cookie['thirdparty'] == 1 ) {
    		add_filter( 'pys_disable_by_gdpr', '__return_false' );
    	}
    	
    }
    
    • This topic was modified 8 years, 1 month ago by nickfr.
    • This topic was modified 8 years, 1 month ago by nickfr.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Conversios

    (@tatvic)

    Hi Nick,

    Thank you for writing to us!

    It should work but it’s totally at your risk. You can definitely try this but our plugin will not responsible if something will not work or break the functionality after adding this.

    Thanks & Regards,

    Thread Starter nickfr

    (@nickfr)

    pixel your site plugin says
    Plugins and themes can use pys_disable_by_gdpr filter to disable tracking.
    have you a similar filter to use it in the above function?

    Plugin Author Conversios

    (@tatvic)

    Hi Nick,

    No, currently the plugin doesn’t have the similar filters in.

    Regards,

    Thread Starter nickfr

    (@nickfr)

    please consider adding this feature.
    Many gdpr plugin use this function to block a plugin from loading scripts.
    Adding generic google script for ecommerce to header is not always an option and your plugin is one way for many websites!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘integrate with gdpr plugin filter’ is closed to new replies.