• Hi

    I need to delay the GTM JS execution in order to get better results in Google Page Insights.

    Any idea how to do that? I didn’t find a setting for that in the plugin.

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

Viewing 1 replies (of 1 total)
  • Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi @sarbel,

    Thanks for asking.

    There is no delay setting in the plugin, and this is intentional, because delaying GTM costs you data. Events that fire before the container has loaded are lost, consent mode signals arrive late, and on a WooCommerce site you can end up missing conversions. The PageSpeed score improves while the tracking gets worse, and the tracking is the reason the plugin is there in the first place.

    What the plugin does instead is load its own scripts with the defer attribute, so that they do not block rendering. The container itself is loaded the way Google specifies, because GTM has to be available early enough for the events on the page.

    If PageSpeed reports Google Tag Manager as a problem, it is usually worth looking at what is inside the container rather than delaying the container. A heavy third party tag firing on all pages is much more often the real cost than gtm.js itself. If you still want to delay it, that is a feature offered by caching and optimization plugins such as WP Rocket or Perfmatters, usually called “delay JavaScript execution”. Please be aware that you are trading measurement accuracy for the score, and test your conversions afterwards.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.