I’ve read thru many feeds and tried many things, but can’t get the GTM, no script, recognized in <body>.
I have the main Tag Working, but for the body tag keep getting “GTM no-script code not found: either missing or not in <body>”.
All my pages are built with GP Premium 1.6.2, Child Theme, Elementor Canvas Templates, Elementor Pro 2.0.7.
I’ve added the GTM script to the wp_head Hook.
Added the GTM noscript to the Before Header Hook and to the child theme functions file as directed in other posts,
added after // END ENQUEUE PARENT ACTION
===================================================
// FP 052218 added per GeneratePress for Google Tag Manager body
add_action( ‘generate_before_header’, ‘tu_add_google_tag_manager’, 0 );
function tu_add_google_tag_manager() { ?>
<!– Google Tag Manager (noscript) –>
<noscript><iframe src=”https://www.googletagmanager.com/ns.html?id=GTM-XXXXXXX”
height=”0″ width=”0″ style=”display:none;visibility:hidden”></iframe></noscript>
<!– End Google Tag Manager (noscript) –>
<?php }
// FP 052218 end of Google Tag Manager
==================================================
Per other posts, I’m not using any cache plugins.
Any suggestions to get GTM fully implemented in the <body>