Site logo

Archived topic

Google Tag Manager not working in new elements hook

5 replies · Started by Joseph on November 28, 2018

Viewing posts 1–6 of 6

So I put the top code in the wp_head and the bottom code in the "before_header" element/hook and it's not working. Tag Assistant says there are a few errors. It says

-An error occured while the tag was fired: net::ERR_ABORTED ?
-Error while sending request: net::ERR_ABORTED
-GTM no-script code not found: either missing or not in <body>

Am I missing something? It's set to display across the entire site, I refreshed cache. I also tried execute php and then shortcodes to no avail.

Hi there,

Can you show me the two blocks of code you added in Hooks Elements?

Make sure you highlight the code and click the code button in the tool bar so they show up correctly:
I'm some code

Let me know :)

<!-- 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-KVJVV4S');</script>
<!-- End Google Tag Manager -->
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KVJVV4S"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

Can you change priority to 0 on the second code?

Let me know :)

It works!

Awesome :)

This archived topic is closed to new replies.