[Support request] Web hooks for Google Tag Manager

Home Forums Support [Support request] Web hooks for Google Tag Manager

Home Forums Support Web hooks for Google Tag Manager

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #854439

    Hello again –

    Quick question for you guys. I’m currently adding Google Tag Manager code to my site, and I need to add two snippets of code – one in the <head> of every page, and one immediately after the opening <body> tag.

    I’m pretty sure I can use webhooks to add the code into the <head> of every page by using wp_head on every page with a position of 2 (so it’s below my GA tag). However, I’m not quite sure how to use a webhook to add the second bit of code right after the opening <body> tag. Is it possible to do this with a webhook?

    Also, I’m assuming I need to put the Google Tag Manager code in the <head> below my GA tag for Google Analytics?

    Thanks as always! I’ve included the two snippets of code below for reference.

    – Evan

    Paste this code as high in the <head> of the page as possible on every page:

    <!– Google Tag Manager –>
    new Date().getTime(),event:’gtm.js’});var f=d.getElementsByTagName(s)[0],
    <!– End Google Tag Manager –>

    Additionally, paste this code immediately after the opening <body> tag:

    <!– Google Tag Manager (noscript) –>
    <noscript><iframe src=”https://www.googletagmanager.com/ns.html?id=GTM-NJHHGGJ&#8221;
    height=”0″ width=”0″ style=”display:none;visibility:hidden”></iframe></noscript>
    <!– End Google Tag Manager (noscript) –>

    GP Premium 1.7.8
    Customer Support

    Hi there,

    the before_header hook with the priority set to zero will place the second tag after the opening body tag.

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