[Support request] Which hook to use for inserting script right after

Home Forums Support [Support request] Which hook to use for inserting script right after

Home Forums Support Which hook to use for inserting script right after

  • This topic has 2 replies, 3 voices, and was last updated 7 years ago by Tom.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #302784
    Bahador

    I need to add Google’s Tag Manager script immediately after opening <body>. Which hook field should I use?

    #302785
    Leo
    Staff
    Customer Support

    Hi there,

    wp_head should work.

    Let me know.

    #302821
    Tom
    Lead Developer
    Lead Developer

    Here’s from their instructions:

    Copy and paste the code snippets into your website as instructed. The <script> portion of the JavaScript snippet will be placed in the of your web page’s HTML output, and the <noscript> section should appear immediately after the opening <body> element.

    So the <script> portion goes into the wp_head hook, and the <noscript> section should go into the Before Header hook.

    Hope this helps 🙂

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