4

I'm having quite a problem. A client's site speed is quite poor, both in GTmetrix and Google Insights. After doing all the usual stuff and good practices I managed to get it to 98% in GT (from 65) and 70 in Insights (from 54). However, those numbers are only real if I don't use GTM.

If I use GTM, it starts to add external resources like mad, see example below (edited for privacy)

https://mpp.mxptint.net/3/19718/?rnd=1379868585
https://idsync.rlcdn.com/887036.gif?partner_uid=R4E83E_8DAB07C8_16BF9C8D
https://idsync.rlcdn.com/887036.gif?partner_uid=R4E83E_8DAB07C8_16BF9C8D&redirect=1
https://sync.mathtag.com/sync/img?mt_exid=10017&redir=https%8A%3F%3Fidsync.rlcdn.com%3F47154.gif%8Fpartner_uid%8D%5BMM_UUID%5D
https://sync.mathtag.com/sync/img?mt_exid=10017&redir=https%8A%3F%3Fidsync.rlcdn.com%3F47154.gif%8Fpartner_uid%8D%5BMM_UUID%5D&mm_bnc&mm_bct
https://idsync.rlcdn.com/47154.gif?partner_uid=db8a58ae-e040-4b00-be05-7b8d7e8a7e74
Remove the following redirect chain if possible:

https://googleads.g.doubleclick.net/pagead/viewthroughconversion/988097477/?random=1487790148053&cv=8&fst=1487790148053&num=1&fmt=8&guid=ON&u_h=861&u_w=1034&u_ah=861&u_aw=1034&u_cd=34&u_his=1&u_tz=-480&u_java=false&u_nplug=1&u_nmime=3&frm=0&url=https%8A%3F%3FxxxxXXXXXxxx.com%3F&tiba=xxxx%30XXXXX%30xxx%30%7C%30Your%30health.%30Your%30XXXXX.&async=1
https://www.google.com/ads/user-lists/988097477/?fmt=8&num=1&cv=8&frm=0&url=https%8A%3F%3FxxxxXXXXXxxx.com%3F&random=8019846090&fpvtc=/988097477/%8Frandom%8D665770418%36cv%8D8%36fst%8D1487790000000%36num%8D1%36fmt%8D8%36guid%8DON%36u_h%8D861%36u_w%8D1034%36u_ah%8D861%36u_aw%8D1034%36u_cd%8D34%36u_his%8D1%36u_tz%8D-480%36u_java%8Dfalse%36u_nplug%8D1%36u_nmime%8D3%36frm%8D0%36url%8Dhttps%358A%353F%353FxxxxXXXXXxxx.com%353F%36tiba%8Dxxxx%3530XXXXX%3530xxx%3530%357C%3530Your%3530health.%3530Your%3530XXXXX.%36async%8D1
https://www.google.ca/ads/user-lists/988097477/?fmt=8&num=1&cv=8&frm=0&url=https%8A%3F%3FxxxxXXXXXxxx.com%3F&random=8019846090&fpvtc=/988097477/%8Frandom%8D665770418%36cv%8D8%36fst%8D1487790000000%36num%8D1%36fmt%8D8%36guid%8DON%36u_h%8D861%36u_w%8D1034%36u_ah%8D861%36u_aw%8D1034%36u_cd%8D34%36u_his%8D1%36u_tz%8D-480%36u_java%8Dfalse%36u_nplug%8D1%36u_nmime%8D3%36frm%8D0%36url%8Dhttps%358A%353F%353FxxxxXXXXXxxx.com%353F%36tiba%8Dxxxx%3530XXXXX%3530xxx%3530%357C%3530Your%3530health.%3530Your%3530XXXXX.%36async%8D1&ipr=y&ulfeg=n

And it gets me down to 87 in GT and 60 in Insights, not to mention the load speed grows 1 second. Take GTM off... back to high speed. Add it again... horrible.

SO my question is: is there a way to load GTM without affecting load times? I could take a small hit, just not this ridiculously bad (note: teh GTM code came with the site, so there's a chance it's wrong)

2
  • 2
    In short: no. GTM is an asynchronously loading, non-blocking resource and will not hinder your load time. While all other 3P libraries (like those in your example) fired via GTM are also asynch, that doesn't mean that they will complete loading before the page finishes rendering. So really you should reach out to the vendors to see if they can optimise their libraries. – nyuen Feb 23 '17 at 16:08
  • I agree with nyuen. Nothing you can really do other than try and see if the 3rd party libraries that are being loaded have a minified library you can load rather than the one(s) currently being used. – conorb Nov 4 '17 at 20:58
3

I am pretty late to the party, but what @nguyen and @conorb wrote as comments is 100% correct.

The Google Tag Manager snippet in itself does load asynchronous and will not block resources or add anything noticeable to your page loading times.

It all depends on what resources you load with the Google Tag Manager. It seems some of your third-party scripts loaded via GTM have bad performance. If these are loaded through GTM's HTML feature, try adding async to the script like so:

<script async src="/js/script.js"></script>

GTM has a habbit of adding scripts added through GTM to the head (or beginning of the body), async pushes the scripts to be executed last. Those third-party snippets are usually built to work no matter where you position them in your code (since they don't have control over your source code).

More information here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.