Okay
  Public Ticket #1775817
Inserting Script Just After <body> tag | Google Tag Manager
Closed

Comments

  •  6
    David started the conversation

    Greetings!

    Installing Google Tag Manager now requires an additional step. I am familiar with the Insert Headers and Footers plugin by WP Beginner, and can use that for my Header script.

    But, how do you suggest  "past[ing] this code immediately after the opening <body> tag" which Tag Manager now  requires?

    I know I can go to Appearance/Editor to edit the Theme Header (header.php). But is that the best solution? If so, I'm assuming the edit will be lost after updating the theme. If I need to go this route, should I simply place the script here, on line 147?:

    Just looking for an easy way to universally add the script to every page, post and product "immediately after the opening <body> tag."

    Thanks!

  •  8,996
    Tahir replied

    Yes that should work. You can also add it to a Child Theme header.php . 

    Best 


    ThemeNectar Support Team 

  • Aleksei replied

    How do you make a header.php? Just add a file called header.php in the child theme folder and add the code? Should there be something else in the file?

  •  8,996
    Tahir replied

    @Aleksei, Simply copy paste the header.php from the Parent theme to the Child Theme and then edit it .

    Best


    ThemeNectar Support Team