Google Tag Manger adds code at bottom of page

Here’s the page: http://stancerealestate.com/7940cherry/

I’m using a child theme. I added the Google Tag Manager Code on the functions page.

I created the /framework/views/header/base.php file and added the override code on that page.

However, I’m still getting some tracking code at the bottom of my page. Not sure why.

Thanks for your help!

Hi there,

I suggest that you avoid using that way for your code. Kindly make use of the plugin below instead:

You can install the plugin by going to X > Overview menu and scroll down to find the extension.

Thank you.

It looks like this means that I can’t use Google’s Tag Manager, is this correct? Also, I’m running Monster Insight. Does the plugin you’re recommending provide better support and reporting? Can the two work together? Thank you.

Hello There,

You can always use Google Tag manager. I am just guessing that maybe you have added it incorrectly and that is why it is being added in your footer instead of the header. Could you please post the custom code which you added in the child theme’s functions.php file in your next reply?

Thank you in advance.

Please use the Google Analytics plugin like @christopher.amirian has suggested previously. It will output code either in the head or in the footer so you don’t have to use custom code. The X Google Analytics extension and “adding action to the head” works the same so it is safer to use the plugin.

If you need more features like reporting, you’ll need an advanced plugin like this.

If you wish to continue using functions.php, please try removing functions in there like your WooCommerce code to see if that causes issues.

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.