• Resolved myithubau

    (@myithubau)


    Hi,

    Our Mobile response time is not reducing and one of the major reason is due to so many JS loading for Google Manager.

    https://www.myithub.com.au

    Can you please advise if the setting are correct.

    • This topic was modified 3 months, 1 week ago by myithubau.

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

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Torben Lundsgaard

    (@torbenlundsgaard)

    Please go to ‘GTM Kit > Help > Support > Share system data with the GTM Kit support team’ and enter the support ticket: FS819-DAC86

    Thread Starter myithubau

    (@myithubau)

    hi,

    I have just sent, Since we are on Woocommerce, Shall we need to Activate the WooCommerce integration also or its not mandatory.

    Regards,

    Plugin Author Torben Lundsgaard

    (@torbenlundsgaard)

    You should activate the WooCommerce integration or you will miss out on a lot of valuable data.

    I see that you have enabled the option GTM Kit > General > Container > load_delayed_js event, which will fire the event ‘load_delayed_js event’ on page load. If you combine this with delaying JavaScript execution in WP Rocket > File optimization > Delay JavaScript execution the event ‘load_delayed_js’ event will be delayed until user interaction.

    If you combine your current triggers in Google Tag Manager with the ‘load_delayed_js’ event this means that the tags will be delayed until user interaction and this will improve your page speed score.

    If you are not already using ‘Delay JavaScript Execution’ you should be aware that it may break some funcitonality so you have test and tweak the configuration of it.

    Thread Starter myithubau

    (@myithubau)

    I have read the message and its already configured as per your recommendations –
    load_delayed_js event is ON

    ?Delay JavaScript execution in ON in WP rocket.
    What else are you proposing to change?

    Plugin Author Torben Lundsgaard

    (@torbenlundsgaard)

    I have just tested your site and load_delayed_js is firing on page load before any user interaction. This means that WP Rocket is not delaying the script that is firing the event. Either there is a problem with your WP Rocket configuraion or something else is triggering the Delay JavaScript Execution to trigger.

    Thread Starter myithubau

    (@myithubau)

    https://workdrive.zohopublic.com.au/external/c3aa46ea6ae403ee7826210cfd8756a096198acccfb821db5f52349aa7f289ee

    that is what we are not able to understand since its delaying to load our site


    Google Tag Manager?tag-manager?

    1,688?ms

    1,524?ms

    109?ms

    • This reply was modified 3 months, 1 week ago by myithubau.
    Plugin Author Torben Lundsgaard

    (@torbenlundsgaard)

    The source code of your site shows that the script is set to be dalayed

    <script type="rocketlazyloadscript" id="gtmkit-delay-js-before"> dataLayer.push({"event" : "load_delayed_js"}); </script>

    The delay function in WP Rocket is based on events like “mouseover”, “keydown”, “touchstart”, “touchmove”, “wheel” and if any of theese interaction events are triggered the delayed scripts will be excecuted. Other scripts/plugins may trigger these events causing the excecution, so this is really hard to debug.

    Your problem is related to WP Rocket so should reach out the the WP Rocket support. I’m afraid I can’t help you any further.

    Thread Starter myithubau

    (@myithubau)

    hi Torben,

    Please check response from WP Rocket

    I’ve checked your website and seems to be there are some GTMkit scripts that are not being delayed, take a look:

    The scripts on the red squares are not delayed:

    703db774a854fc00b67e1f249c4bfa13.png

    Full-size image here: https://i.imgur.com/xI4T0Pd.png

    Those scripts (which in turn are instantiating GTM scripts) are being excluded from Delay JavaScript execution because the data-nowprocket attribute has been added to them:

    ef6fd3f1fcbff1a2f3997b90a32b49bb.png

    Full-size image here: https://i.imgur.com/iiJlSJy.png

    Further information in this article.

    And this attribute it’s being added by GTMKit, in this function:

    5b072ddefcac3b2ce0156ef8098a9fa4.png

    Full-size image here: https://i.imgur.com/QxaAmkw.png

    Here you can see the complete GTMKit code.

    Plugin Author Torben Lundsgaard

    (@torbenlundsgaard)

    That is expected and as it should be.

    Your problem is that the following script should be delayed and it looks like it is beeing delayed. However something on you site is triggering interaction causing it to load immediately.

    <script type="rocketlazyloadscript" id="gtmkit-delay-js-before"> dataLayer.push({"event" : "load_delayed_js"}); </script>
    Thread Starter myithubau

    (@myithubau)

    Hi, I have updated your plugin and Wp rocket also, the issue seems to have fixed. Can you please recheck ?

    Plugin Author Torben Lundsgaard

    (@torbenlundsgaard)

    Your score is 86: https://pagespeed.web.dev/analysis/https-www-myithub-com-au/l3qx9asqsk?form_factor=mobile

    You just need to check if you are receiving data in Google Analytics

    Plugin Author Torben Lundsgaard

    (@torbenlundsgaard)

    Closing this

    Thread Starter myithubau

    (@myithubau)

    hi,
    Its not fixed still.
    The issue with your website are these scripts:

    Full-size image here: https://i.imgur.com/Dq57qZ0.png

    Especially the GTM ones. And those scripts are being triggered by these inline scripts, which are being excluded from Delay JavaScript execution by adding the attribute data-nowprocket:

    Full-size image here: https://i.imgur.com/whXoLKc.png

    I will try to explain myself as clearly as possible:

    For WP Rocket to be able to delay the execution of a script, that script must be present in the HTML of the page, only then WP Rocket can add the RocketLazyloadscript attribute to delay it, but if that script is not present in the HTML but is dynamically triggered (as in this case) by a script that was itself excluded from the feature, then WP Rocket will not be able to delay it and therefore that script will end up affecting your score if it consumes too much execution time.

    Thread Starter myithubau

    (@myithubau)

    Hi,

    It has been 4 days since I am waiting for your response.

    he LCP score is indeed mainly affected by the loading of JavaScript files, as you have pointed out earlier in the ticket. On your website that JavaScript code comes primarily from the Google Tag Manager implementation. You have a plugin named gtm-kit with which you load various analytics JavaScript code and about 85% of the JavaScript loading time is related to code brought through the Google Tag Manager:

    https://www.myithub.com.au/Screenshot%202024-08-21%20at%2018.44.24.png

    For the sake of testing purposes, I disabled temporarily the gtm-kit plugin and retested the mobile performance with the Google PageSpeed Insights too. As you can see from the results below, the mobile score was instantly increased to 73:

    https://pagespeed.web.dev/analysis/https-www-myithub-com-au/qk9m8azo1y?form_factor=mobile

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