[Resolved] Google Tag Manager not working in new elements hook

Home Forums Support [Resolved] Google Tag Manager not working in new elements hook

Home Forums Support Google Tag Manager not working in new elements hook

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #743019
    Joseph

    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.

    #743089
    Leo
    Staff
    Customer Support

    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 πŸ™‚

    #743986
    Joseph
    <!-- 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) -->
    #744006
    Leo
    Staff
    Customer Support

    Can you change priority to 0 on the second code?

    Let me know πŸ™‚

    #744802
    Joseph

    It works!

    #744864
    Leo
    Staff
    Customer Support

    Awesome πŸ™‚

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.