Support » Plugin: GDPR Cookie Compliance (CCPA, PIPEDA ready) » Activate 3rd party cookies on specific article/page

  • Resolved koupida

    (@koupida)


    Dear team,

    I would like to know if it is possible to activate a script on a specific page/article for a media campaign, while other scripts (GA…) are still active on all page.

    Thanks a lot for your answer.

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

    (@mooveagency)

    Hi there,

    Thanks for using our plugins.

    You can include the scripts from settings for specific pages only by using custom hooks (select the code snippet you’d like to use and add it to functions.php)

    HOOK to GDPR custom 3RD-PARTY script by php – HEAD

    add_action('moove_gdpr_third_party_header_assets','moove_gdpr_third_party_header_assets');
    function moove_gdpr_third_party_header_assets( $scripts ) {
        if ( is_page('X') ) :
    	$scripts .= '<script>console.log(“third-party-head”);</script>';
        endif;
        return $scripts;
    }

    HOOK to GDPR custom 3RD-PARTY script by php – BODY

    add_action('moove_gdpr_third_party_body_assets','moove_gdpr_third_party_body_assets');
    function moove_gdpr_third_party_body_assets( $scripts ) {
        if ( is_page('X') ) :
    	$scripts .= '<script>console.log(“third-party-body”);</script>';
        endif;
        return $scripts;
    }

    HOOK to GDPR custom 3RD-PARTY script by php – FOOTER

    add_action('moove_gdpr_third_party_footer_assets','moove_gdpr_third_party_footer_assets');
    function moove_gdpr_third_party_footer_assets( $scripts ) {
        if ( is_page('X') ) :
    	$scripts .= '<script>console.log(“third-party-footer”);</script>';
        endif;
        return $scripts;
    }

    HOOK to GDPR custom ADVANCED-PARTY script by php – HEAD

    add_action('moove_gdpr_advanced_cookies_header_assets','moove_gdpr_advanced_cookies_header_assets');
    function moove_gdpr_advanced_cookies_header_assets( $scripts ) {
        if ( is_page('X') ) :
    	$scripts .= '<script>console.log(“advanced-head”);</script>';
        endif;
        return $scripts;
    }

    HOOK to GDPR custom ADVANCED-PARTY script by php – BODY

    add_action('moove_gdpr_advanced_cookies_body_assets','moove_gdpr_advanced_cookies_body_assets');
    function moove_gdpr_advanced_cookies_body_assets( $scripts ) {
        if ( is_page('X') ) :
    	$scripts .= '<script>console.log(“advanced-body”);</script>';
        endif;
        return $scripts;
    }

    HOOK to GDPR custom ADVANCED-PARTY script by php – FOOTER

    add_action('moove_gdpr_advanced_cookies_footer_assets','moove_gdpr_advanced_cookies_footer_assets');
    function moove_gdpr_advanced_cookies_footer_assets( $scripts ) {
        if ( is_page('X') ) :
    	$scripts .= '<script>console.log(“advanced-footer”);</script>';
        endif;
        return $scripts;
    }

    I hope this helps.

Viewing 1 replies (of 1 total)
  • The topic ‘Activate 3rd party cookies on specific article/page’ is closed to new replies.