This approach helps reduce the initial loading time of web pages, which can significantly improve performance metrics important for user experience and SEO, such as First Contentful Paint (FCP), Largest Contentful Paint (LCP), and Time to Interactive (TTI). These improvements are critical because Google uses them as part of its Core Web Vitals, which influence search engine rankings.
GTM Kit can be configured to push the event
load_delayed_js on page and the script that does this can be delayed by af pagespeed optimization plugin. This means that
load_delayed_js will be pushed to the GTM container on user activity. You can use this in GTM to define a trigger that fires on user activity.