Title: Container code placement
Last modified: February 14, 2019

---

# Container code placement

 *  Resolved [betterend](https://wordpress.org/support/users/betterend/)
 * (@betterend)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/container-code-placement/)
 * Hi,
 * I’m a bit confused about Container code placement, what is the best option to
   choose?
 * Currently i selected custom and placed <?php if ( function_exists( ‘gtm4wp_the_gtm_tag’)){
   gtm4wp_the_gtm_tag(); } ?>
 * after the opening <body> in all pages using tracking code manager to insert the
   snippet.
 * Will that be ok?
 * Is there any other and better way?
 * Thank you
    -  This topic was modified 7 years, 3 months ago by [betterend](https://wordpress.org/support/users/betterend/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcontainer-code-placement%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * (@duracelltomi)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/container-code-placement/#post-11209325)
 * Hi,
 * `Custom` is the safest way to add the container code but it is important to see
   that nowadays this only decided where to put the so called noscript part of the
   code. The main container code will be added to the right place anyway.
 * On your site, codeless should be safe as well.
 *  Thread Starter [betterend](https://wordpress.org/support/users/betterend/)
 * (@betterend)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/container-code-placement/#post-11214673)
 * Hi,
 * Thank you for your kind support and reply.
 * So i can stay on Custom with the snippet insert right?
 * Just in case i put the settings on Codeless, i should remove the code snippet
   i added right?
 * Thank you,
 *  Plugin Author [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * (@duracelltomi)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/container-code-placement/#post-11217000)
 * Yes, you can keep using custom of course just make sure that theme updates do
   not remove this added line of PHP code or make sure you re-add this line after
   a theme update 🙂
 * If you switch to codeless, you should remove that line but my plugin has a protection
   that makes sure the noscript part of the container code is only outputted once.
 *  Thread Starter [betterend](https://wordpress.org/support/users/betterend/)
 * (@betterend)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/container-code-placement/#post-11221547)
 * Thank you a lot for your kind support 🙂
 *  Thread Starter [betterend](https://wordpress.org/support/users/betterend/)
 * (@betterend)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/container-code-placement/#post-11221968)
 * Hi again,
 * Kindly, I have installed Google tag assistant extension on Chrome and it mentions
   in the TAG ASSISTANT REPORT after recording “Same web property ID is tracked 
   twice” for google analytics.
 * And in the GOOGLE ANALYTICS REPORT it mentions something about the duplicate 
   firing events.
 * Thank you
 *  Plugin Author [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * (@duracelltomi)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/container-code-placement/#post-11222080)
 * This is because you have a Google Analytics tracking code in your site code that
   has been added either manually or via another plugin. If you remove this GA tracking
   code, all those messages will disappear
 *  Thread Starter [betterend](https://wordpress.org/support/users/betterend/)
 * (@betterend)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/container-code-placement/#post-11225925)
 * Thank you a lot for the clarification and quick support 🙂

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

The topic ‘Container code placement’ 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/)

 * 7 replies
 * 2 participants
 * Last reply from: [betterend](https://wordpress.org/support/users/betterend/)
 * Last activity: [7 years, 3 months ago](https://wordpress.org/support/topic/container-code-placement/#post-11225925)
 * Status: resolved