• Resolved elbrr

    (@elbrr)


    Greetings!

    Our site has an issue with displaying a white screen for about 1-1.5 seconds on each page while navigating through the site, beginning when the “Accept All” button is clicked.

    The only thing we’ve been able to do to make the white screen go away is dequeue the plugin’s main.js on line 386 in wp-content/plugins/gdpr-cookie-compliance/class-moove-gdpr-actions.php. Trying different priorities for the enclosing function didn’t help.

    I have the premium version installed, at the moment, and have tried the following in functions.php since it looked like (from the performance console in Chrome) that Lity was thrashing the layout:

    add_action( 'gdpr_enqueue_lity_nojs', '__return_false' );
    add_action( 'gdpr_disable_lity_enqueue', '__return_true' );

    The problem persists, however, so we removed those two lines.

    Have you seen this happen before? Any insights on things to try?

    Thank you!

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

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

    (@mooveagency)

    Hi @elbrr,

    Thanks for using our plugins.

    It seems the issue is related to AJAX script inject, you can add the following code snippet to your functions.php

    add_action( 'gdpr_cc_prevent_ajax_script_inject', '__return_true' );

    Also, you can keep the add_action( 'gdpr_enqueue_lity_nojs', '__return_false' );
    code snippet as well. The ‘gdpr_disable_lity_enqueue’ could be removed.

    Hope this helps.

    Thanks

    Thread Starter elbrr

    (@elbrr)

    Thank you for the reply — I’ve implemented the code you suggest and the white screen is a little faster when I click “Accept All” but just as long as before when navigating to other pages. Any other ideas for things to try?

    Thank you!

    Plugin Author Moove Agency

    (@mooveagency)

    Hi @elbrr,

    It seems you have an “Anti-flicker snippet” added to GDPR Cookie Compliance plugin.
    The white page could be related to this “Anti-flicker” rule with Google Tag Manager which is not recommended. Read more about the flicker here:
    https://support.google.com/optimize/answer/7100284?hl=en

    So the recommended fix to you is to update the scripts on your site following the steps below:

    3rd party – Header:

    <!-- Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXX-Y"></script>
    <script>
    	dataLayer = [{}];
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
    
      gtag('config', 'UA-XXXXXXX-Y');
    </script>
    <!-- End Google Analytics -->
    
    <!-- Google Tag Manager -->
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','GTM-ZZZZZZ');</script>
    <!-- End Google Tag Manager -->

    3rd Party – Body

    <!-- Google Tag Manager (noscript) -->
    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-ZZZZZZ"
    height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
    <!-- End Google Tag Manager (noscript) -->

    Note: Replace the UA-XXXXXXX-Y to your Google Analytics ID, and the GTM-ZZZZZZ to your Google Tag Manager ID.

    Hope this fixes the white delay on your end but if still exists, you have to check the third party scripts loaded by your Google Tag Manager.

    Thanks

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

The topic ‘White Screen During Navigation’ is closed to new replies.