Support » Plugin: GDPR Cookie Compliance (CCPA ready) » Changing priority of third party cookie

  • Resolved olegburakov

    (@olegburakov)


    Hello! I’ve got google analytics at the third party header section https://i.imgur.com/xPVlo70.png but it loads too late.

    I disable ajax loading as you answered to some similar question by this
    add_action( 'gdpr_cc_prevent_ajax_script_inject', '__return_true' );

    But still this looks a little like a hack to me, because the 3rd party HEAD scripts loading in the BOTTOM of the page https://i.imgur.com/Yh7flWT.jpeg. SEO guys are making A/B testing via google analytics and they want immediately loading of the GA in the head without any delays. Is it possible to output this section in the <head>? Thanks!

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

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

    (@mooveagency)

    Hi @olegburakov,

    Thanks for using our plugins.

    You can add the following code snippet to your functions.php in order to get rid of the execution delay:

    add_filter( 'gdpr_init_script_delay', 'gdpr_delay_script_execution', 20, 1 );
    				function gdpr_delay_script_execution( $ms ) {
    					return 0; // 5000 ms = 5 seconds.
    				}

    By default, there is a 2 second delay to improve the CLS.

    Hope this helps.

    Thread Starter olegburakov

    (@olegburakov)

    Thank you a lot @mooveagency !

    I’ll test it and give a feedback!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.