Responsive WordPress Theme – Caliber

A theme with simple controls and limitless potential. Work fast and build an amazing website!   Find out more »

UpThemes – Beautiful WordPress Themes

Create a site your church, gallery, newspaper, blog, recipes, band and more!   See the themes »

Need a little help?  Find answers quickly by searching the forum.
Group Admins
  • andy
  • jeffw
  • admin

Support for: Moxie – Responsive Theme for WordPress

Moxie

Public Group  |  active 4 years, 4 months ago ago
Viewing post 1 to 2 (2 total posts)

Not sure where to place Google Tag Manager code

  • gadgetguru

    said

    Im using a plugin to add google tag manager to my site. However not sure where to place this code

    Google recommends that the Google Tag Manager script is loaded straight after the opening tag. For this to work, you will need to add the following piece of code into your template file just after the tag: <?php do_action( 'body_open' ); ?> . Otherwise the GMT script will be added at the bottom of your site and might not track the way you want it to. For WordPress 5.2 and up, it is recommended to use <?php wp_body_open(); ?> straight after the body tag. View the Quickstart Guide

  • jeffw

    said

    As far as I’m aware, the Google Analytics tracking code needs to be added just after the <body> tag. In Moxie, the <body> tag is output in the ‘header.php’ template.

    Keep in mind that if you modify core theme files then each time you update the theme you will need to make all of those modifications again to the updated theme files. If you are going to customise PHP templates it’s best to do that in a child theme because that will make it easier for you to update the parent theme. There are more details about how to create a child theme for Moxie here → http://para.llel.us/support/tutorials/making-a-moxie-child-theme/

    I’ve never used the Google Tag Manager plugin so I can’t really help much with it. If you need assistance with any third-party plugin, please ask the plugin author for support.

    Thanks.

Viewing post 1 to 2 (2 total posts)
Topic tags: tag manager