Site logo

Archived topic

Goolge Tag Manager / Elementor Canvas

3 replies · Started by Fitz on May 22, 2018

Viewing posts 1–4 of 4

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>

Using the Canvas page template in Elementor removes everything theme related from the page, including our hooks.

You can:

a) Ask Elementor what you can do within their page template.
b) Use the default page template, and disable the GP elements using the Disable Elements metabox.

Thank You for the very quick response, and for the information to get GTM working.

No problem :)

This archived topic is closed to new replies.