Title: Adding tag manager PHP to child theme
Last modified: August 22, 2016

---

# Adding tag manager PHP to child theme

 *  [brentonjohnson](https://wordpress.org/support/users/brentonjohnson/)
 * (@brentonjohnson)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/adding-tag-manager-php-to-child-theme/)
 * Hi everyone
 * would someone please give me the code needed to put in my child theme’s function.
   php so i can get the custom implementation of this plugin?
 * I know it needs to be added with an enqueue function or something, but i’m not
   sure exactly how this is done.
 * `<?php if ( function_exists( 'gtm4wp_the_gtm_tag' ) ) { gtm4wp_the_gtm_tag();}?
   >`
 * Thank you in advance
 * [https://wordpress.org/plugins/duracelltomi-google-tag-manager/](https://wordpress.org/plugins/duracelltomi-google-tag-manager/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [alexisyfido](https://wordpress.org/support/users/alexisyfido/)
 * (@alexisyfido)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/adding-tag-manager-php-to-child-theme/#post-5476154)
 * You put the code in the child theme….header.php
    after <body>
 * That’s what he said in one of the support comments.
 * <?php if ( function_exists( ‘gtm4wp_the_gtm_tag’ ) ) { gtm4wp_the_gtm_tag(); }?
   >
 *  Plugin Author [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * (@duracelltomi)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/adding-tag-manager-php-to-child-theme/#post-5476186)
 * That is right, you only need to edit your header.php as alexisyfido said.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Adding tag manager PHP to child theme’ is closed to new replies.

 * ![](https://ps.w.org/duracelltomi-google-tag-manager/assets/icon-256x256.png?
   rev=1708451)
 * [GTM4WP - A Google Tag Manager (GTM) plugin for WordPress](https://wordpress.org/plugins/duracelltomi-google-tag-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/duracelltomi-google-tag-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/reviews/)

## Tags

 * [child theme](https://wordpress.org/support/topic-tag/child-theme/)
 * [enqueue](https://wordpress.org/support/topic-tag/enqueue/)

 * 2 replies
 * 3 participants
 * Last reply from: [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/adding-tag-manager-php-to-child-theme/#post-5476186)
 * Status: not resolved