Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi Rick,

    I downloaded your free template to check what to do.
    Open header.php and look at this line:

    <body <?php body_class(); ?>>

    (line 25 in my view)

    Press an enter after this line and add the following code:
    <?php if ( function_exists( ‘gtm4wp_the_gtm_tag’ ) ) { gtm4wp_the_gtm_tag(); } ?>

    Save and upload this modified header.php

    Hope this helps,
    Thomas Geiger

    Thread Starter RDKiley

    (@rdkiley)

    Thank you, Thomas.

    jfraixedes

    (@jfraixedes)

    Hi there,

    I use the WP Google Tag Manager to put the GTM code there.

    It’s actually really easy and you don’t need to know anything about coding!

    Hope it helps!

    Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi,

    Just to clarify: you are referring to a plugin that hasn’t been updated in over 2 years. Also, this plugin can put the GTM container code into the footer of the page without any coding, just as my plugin. This is not the preferred placement.

    To put the GTM container code to the right place, you still need to apply some coding into your template. This is not an issue with any plugin but with WordPress which does not have a standard hook to handle code injections after the opening body tag.

    Thomas

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How do I put the Google Tag Manager container code next to the opening body tag?’ is closed to new replies.