Streaming live at 10am (PST)

How to insert code GTM (Google Tag Manager) after the tag < body >?

How to insert code GTM (Google Tag Manager) after the tag < body >?

This solution does not work


have you tried adding the HTML as a embed widget as the first element on your project?


Thank you!

It works!

SYMBOLS very helpful.

I’m following this advice but it still gets placed within a div, so I end up with the code below. Tag Manager still seems to work, but I wonder if I’m going to run into problems further down the line?

  <div class="w-embed w-iframe w-script">
    <!-- Google Tag Manager -->
      <iframe src="" height="0" width="0" style="display:none;visibility:hidden"></iframe>
      new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    <!-- End Google Tag Manager -->
1 Like

Really helpful! Thank you.

To make this even easier I create a Global Object of the HTML embed with the script tag in it, then added it to each page, and used the Navigator to make sure that on each page it was right below the body tag.

Thanks again!

1 Like