Regarding Martech script loading early on pageload, affecting the performance of the page. #1918
Replies: 2 comments 2 replies
-
If the MILO_EVENTS.DEFERRED event only fires for the I don't see where martech loading depends on the deferred event though ... when target or MEP is not enabled, then loadMartech happens in the |
Beta Was this translation helpful? Give feedback.
-
@suhjainadobe |
Beta Was this translation helpful? Give feedback.
-
Hello,
Currently, martech script is relying on MILO_EVENTS.DEFERRED event to check if the page has loaded or they wait for 3 seconds to run their scripts. But if there are fragments on the page, they use the loadArea function as well which has loadDeferred function triggering MILO_EVENTS.DEFERRED event before the whole page loads. Thus, the martech scripts starts loading early causing the TBT to increase as it blocks the main script.
Therefore, I would like to have your viewpoint on if it's ok to call the loadDeferred inside the isDoc check which checks if the function is being called by the fragment or the document. By doing this, we have observed that the martech scripts are loading after the page loading has completed, decreasing the TBT.
Before : https://pagespeed.web.dev/analysis/https-main--cc--adobecom-hlx-live-creativecloud-business-teams-resources-how-to-marketing-plan/yx67vje1ko?form_factor=mobile
After: https://pagespeed.web.dev/analysis/https-main--cc--adobecom-hlx-live-creativecloud-business-teams-resources-how-to-marketing-plan/jxe7tsuyvx?form_factor=mobile
For same, we will have to test other blocks like carousel, tables, tabs etc which listen to MILO_EVENTS.DEFERRED event for their respective operations.
Beta Was this translation helpful? Give feedback.
All reactions