JA-Build-Change-Impact Posted July 11 Share Posted July 11 (edited) I have successfully placed the main Google Tag Manager code into the header via the Code Injection section of Squarespace. Site: https://teachingideas4u.com Quote Paste this code as high in the <head> of the page as possible: <!-- Google Tag Manager --> <script>(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-HIDDEN');</script> <!-- End Google Tag Manager --> However, I have an issue with this: where / how to install the "no script" code that goes in the <body> on Squarespace per https://support.google.com/tagmanager/answer/6103696 section 2.4.b and the on page instructions from Google from the Install Google Tag Manager instructions Quote Additionally, paste this code immediately after the opening <body> tag: <!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-HIDDEN" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) --> Edited July 11 by JA-Build-Change-Impact fixed typo & added URL Link to comment
Ziggy Posted July 11 Share Posted July 11 You can generally put that in the footer code injection, just as it is. Please like and upvote if my comments were helpful to you. Cheers! Zygmunt Spray Squarespace Website Designer Contact me: https://squarefortytwo.com 🔌 Ghost Squarespace Plugins (Referral link) 📈 SEO Space (Referral link) ⬛ SquareWebsites Plugins (Referral link) ✨ Spark Plugin (Referral link) ☕ Did I help? Buy me a coffee? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment