Title: Google Tag Manager – Reduce JavaScript execution time
Last modified: August 26, 2024

---

# Google Tag Manager – Reduce JavaScript execution time

 *  Resolved [myithubau](https://wordpress.org/support/users/myithubau/)
 * (@myithubau)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/google-tag-manager-reduce-javascript-execution-time-2/)
 * Hi, Without providing support below ticket was closed, We are having issues with
   is.
 * [https://pagespeed.web.dev/analysis/https-www-myithub-com-au/e3v7ljqugv?form_factor=mobile](https://pagespeed.web.dev/analysis/https-www-myithub-com-au/e3v7ljqugv?form_factor=mobile)
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fgoogle-tag-manager-reduce-javascript-execution-time-2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Plugin Author [Torben Lundsgaard](https://wordpress.org/support/users/torbenlundsgaard/)
 * (@torbenlundsgaard)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/google-tag-manager-reduce-javascript-execution-time-2/#post-17975278)
 * If you add the following line to functions.php in your theme WP Rocket will be
   able to delay all of the GTM Kit scripts including the the GTM container:
   `add_filter('
   gtmkit_header_script_attributes', '__return_empty_array' );`
 *  Thread Starter [myithubau](https://wordpress.org/support/users/myithubau/)
 * (@myithubau)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/google-tag-manager-reduce-javascript-execution-time-2/#post-17975611)
 * Do you mean in Child theme ?
 *  Plugin Author [Torben Lundsgaard](https://wordpress.org/support/users/torbenlundsgaard/)
 * (@torbenlundsgaard)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/google-tag-manager-reduce-javascript-execution-time-2/#post-17975624)
 * yes
 *  Thread Starter [myithubau](https://wordpress.org/support/users/myithubau/)
 * (@myithubau)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/google-tag-manager-reduce-javascript-execution-time-2/#post-17975636)
 * and where exactly do i need to add this code?
 *  Plugin Author [Torben Lundsgaard](https://wordpress.org/support/users/torbenlundsgaard/)
 * (@torbenlundsgaard)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/google-tag-manager-reduce-javascript-execution-time-2/#post-17975699)
 * in functions.php. If you do not have functions.php in you child theme, you must
   create the file and enter:
 *     ```wp-block-code
       <?phpadd_filter('gtmkit_header_script_attributes', '__return_empty_array' );
       ```
   
 *  Thread Starter [myithubau](https://wordpress.org/support/users/myithubau/)
 * (@myithubau)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/google-tag-manager-reduce-javascript-execution-time-2/#post-17975735)
 * Hi, I have added this code to functions.php but there has been no changes.
 *  Plugin Author [Torben Lundsgaard](https://wordpress.org/support/users/torbenlundsgaard/)
 * (@torbenlundsgaard)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/google-tag-manager-reduce-javascript-execution-time-2/#post-17975773)
 * Have you cleared all cache?
 *  Thread Starter [myithubau](https://wordpress.org/support/users/myithubau/)
 * (@myithubau)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/google-tag-manager-reduce-javascript-execution-time-2/#post-17975781)
 * After clearing cache its looking lot better.
 *  Plugin Author [Torben Lundsgaard](https://wordpress.org/support/users/torbenlundsgaard/)
 * (@torbenlundsgaard)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/google-tag-manager-reduce-javascript-execution-time-2/#post-17975794)
 * Your score is now 65: [https://pagespeed.web.dev/analysis/https-www-myithub-com-au/01cr1xsa69?form_factor=mobile](https://pagespeed.web.dev/analysis/https-www-myithub-com-au/01cr1xsa69?form_factor=mobile)
 * Can I close this?
 *  Thread Starter [myithubau](https://wordpress.org/support/users/myithubau/)
 * (@myithubau)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/google-tag-manager-reduce-javascript-execution-time-2/#post-17975810)
 * Yes thanks

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Google Tag Manager – Reduce JavaScript execution time’ is closed to new
replies.

 * ![](https://ps.w.org/gtm-kit/assets/icon.svg?rev=2783020)
 * [GTM Kit - Google Tag Manager & GA4 integration](https://wordpress.org/plugins/gtm-kit/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gtm-kit/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gtm-kit/)
 * [Active Topics](https://wordpress.org/support/plugin/gtm-kit/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gtm-kit/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gtm-kit/reviews/)

 * 10 replies
 * 2 participants
 * Last reply from: [myithubau](https://wordpress.org/support/users/myithubau/)
 * Last activity: [1 year, 9 months ago](https://wordpress.org/support/topic/google-tag-manager-reduce-javascript-execution-time-2/#post-17975810)
 * Status: resolved