gdclarke 1 Report post Posted December 30, 2014 Hi - I'm planning to deploy Google Tags to my DMS site. Wondering if others have done this and if there is a recommended way to implement GTM on a DMS site? Thanks in advance Graham Share this post Link to post Share on other sites
Danny+ 1,327 Report post Posted December 30, 2014 Hi Graham, I am not entirely sure what you mean by Google tags ? Please search our forums, before posting! Share this post Link to post Share on other sites
Simon 248 Report post Posted December 30, 2014 Danny Google tag manager. Its basically a way to add any js snippet to your site via a control panel on google.com gdclarke There are numerous Google Tag plugins in the WordPress plugins repo, take your pick from there. Share this post Link to post Share on other sites
gdclarke 1 Report post Posted December 30, 2014 @Simon_P - Doesn't sound like this is something you guys have much experience with. I've installled DuracellTomi's Google Tag Manager, but the plugin automatically places the script in the footer rather than just inside the HTML BODY as recommended by Google. I would like to avoid making modifications to the DMS template file or creating a Child Theme. The PHP is not a problem, I want to be able to update DMS cleanly. Cheers, Graham Share this post Link to post Share on other sites
Simon 248 Report post Posted December 31, 2014 We use the same plugin, in our child theme we use this: add_action('pagelines_before_site', 'pagelines_tag_manager'); function pagelines_tag_manager(){ if ( function_exists( 'gtm4wp_the_gtm_tag' ) ) { gtm4wp_the_gtm_tag(); } } Share this post Link to post Share on other sites
gdclarke 1 Report post Posted December 31, 2014 Simon - Cool. Just to clarify, 1) use the "skeleton basic" child theme - rename to "mychildtheme" 2) add the above snippet to functions.php 3) activate mychildtheme Other than adding GTM code, this should not impact my existing site? Cheers, Graham Share this post Link to post Share on other sites
Danny+ 1,327 Report post Posted December 31, 2014 You don't need to rename the child theme, but can if you like. Simply add the snippet of code to the child themes functions.php file and then make sure it is the active theme. Please search our forums, before posting! Share this post Link to post Share on other sites