• Resolved benf2489

    (@benf2489)


    Hi,

    Would there be a way to trigger some js when say the third party cookies are enabled / disabled?

    I’m looking to change some form fields should a user opt out of the third party cookies but change this back if or when a user decides to update and opt back in.

    At the moment I’m just checking on the switches themselves on a click event listener and then updating the value but would be neater if it was done around your currently available hooks.

Viewing 1 replies (of 1 total)
  • Plugin Author Moove Agency

    (@mooveagency)

    Hi there,

    Thanks for your comments.

    Unfortunately in the plugin there are no javascript triggers / listeners created for checking the accepted cookies. We’re using WordPress hooks for this.
    You can use our PHP hooks (these will be loaded once the users accepts your cookies) to run your scripts.

    Example below with 3rd party hook:

    add_action('moove_gdpr_third_party_header_assets','moove_gdpr_third_party_header_assets');
    function moove_gdpr_third_party_header_assets( $scripts ) {
    	$scripts .= '<script>alert('third party accepted');</script>';
    	return $scripts;
    }

    Alternatively, you can check the accepted / unaccepted cookies with javascript function below:

    jQuery(document).moove_gdpr_read_cookies()

    I hope this works.

Viewing 1 replies (of 1 total)

The topic ‘Check when cookie tabs switch is changed?’ is closed to new replies.