Title: JS delay
Last modified: July 16, 2026

---

# JS delay

 *  [sarbel](https://wordpress.org/support/users/sarbel/)
 * (@sarbel)
 * [4 weeks, 1 day ago](https://wordpress.org/support/topic/js-delay/)
 * 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](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fjs-delay%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * (@duracelltomi)
 * [3 weeks, 1 day ago](https://wordpress.org/support/topic/js-delay/#post-18973000)
 * Hi [@sarbel](https://wordpress.org/support/users/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](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fjs-delay%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/duracelltomi-google-tag-manager/assets/icon-256x256.png?
   rev=1708451)
 * [GTM4WP - A Google Tag Manager (GTM) plugin for WordPress](https://wordpress.org/plugins/duracelltomi-google-tag-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/duracelltomi-google-tag-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * Last activity: [3 weeks, 1 day ago](https://wordpress.org/support/topic/js-delay/#post-18973000)
 * Status: not resolved