• Resolved peq42

    (@peq42)


    I’d like to request the addition of a “DEFER” to the google analytics tag so it doesn’t affect performance as much. Currently, this plugin is adding 0.3 seconds to my website’s load time on mobile because it doesn’t make use of that(Checked with google’s PageSPeed Insights)

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

Viewing 1 replies (of 1 total)
  • Plugin Support Michelle D.

    (@devmich)

    Hi @peq42,

    Thanks for reaching out!

    To help mitigate render-blocking issues, we currently utilize the async attribute. Our goal is to load Google Analytics as quickly as possible to avoid potential conflicts and for tracking the most accurate statistics.

    But if you prefer to use defer instead of async, here’s a custom code snippet you can use:

    add_filter('monsterinsights_frontend_gtag_script_async', '__return_false');
    
    add_filter('monsterinsights_tracking_analytics_script_attributes', function () {
        return array('defer');
    });

    Let me know if you have further questions.

    Thanks!

Viewing 1 replies (of 1 total)
  • The topic ‘Add “DEFER” to google analytics’ is closed to new replies.