Wordpress LScache Plugin: Best way to use GTM
Last Updated on: Wed, 15 Apr 2026 00:00:02 Hello. I want to add Google Tag Manager to the site. What is the best way to add this code now? (function(w,d,s,l,i) w[l]=w[l]||[] w[l].push( gtm.start: new Date().getTime(),event:gtm.js ) var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!=dataLayer?&l=+l: j.async=true j.src= https://www.googletagmanager.com/gtm.js?id=+i+dl f.parentNode.insertBefore(j,f) )(window,document,script,dataLayer,GTM-PQM3Z84) Hi, edit the theme file ? Best regards, use google sitekit plugin to add it otherwise there are various plugins that insert headers and footers but google actually authors the sitekit plugin and it works (caveat there is a brand new format of TAG and they might not be fully supported)
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference