[Support request] Elements Suggestion for Pagespeed

Home Forums Support [Support request] Elements Suggestion for Pagespeed

Home Forums Support Elements Suggestion for Pagespeed

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #1660673

    Hey Tom & team,

    First of all, thank you to everyone who has been helping with my questions about Pagespeed. David, Elvin and Leo have always been fantastic at finding solutions. As someone who has been working on multiple sites and finally passing CWV for all of them, I wanted to ask a question and make a suggestion. There is really only one more score to further optimize and that is Time to Interactive.

    1. We know delaying Google tags increases Pagespeed scores (TTI in particular) by a significant amount.
    2. Flying Scripts & WP Rocket both offer a delay function for certain tags / js and they both help with TTI tremendously.
    3. But both methods run into the iOS bug where you need to click on links twice before they work. Something to do with the touchscreen of iOS devices. This was first reported in Sept 2020. I have reached out to developers and there is no fix. At least not as of today.

    So this occurred to me. Since we use Elements to hook in Google tags, is there a way to add a function to not inject a specific element for x-seconds? We can then use this to delay running of Google tags (or other 3rd party scripts like Hotjar etc…) to increase Pagespeed scores like Time to Interactive. I am not sure this would by-pass the iOS double clicking issue but I am guessing doing it at the theme level instead of using a 3rd party app to delay scripts “after the fact” may be a better solution?

    If this works, it really would be an industry first and a game changer in my opinion. Thoughts and comment?

    Customer Support

    Hi there,

    great idea – but delaying the ‘loading’ of scripts has to happen on the client side ( browser ). Elements are simply attaching a function callback to a WP Hook. All of this happens on the server side, and delaying a function callback will delay any subsequent code execution… so you would just be adding a delay to server processing your request.


    Thanks for all of your insight David. You are awesome.

    To be honest, I just do not know the skillz to fully understand this topic. I was talking to a publisher colleague in the industry and their site has 40K+ posts. They were able to achieve delaying of 3rd party scripts at the theme level without using plugins so I was hopefuly my idea to delay it at the GP Element level would help with pagespeed. Looks like it may not as I had hoped.

    This CWV is going to hurt many websites out there. I can tell lol.

    If you ever have any ideas on how to delay js scripts, please chime in!

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