Google Tag Manager Code not seen by Google

Hi I have installed some google tags in both the header and the body. Google sees the header but not the body tag. I can see the tag when I view source.

Here is what I put in the functions.php:

// Add Google Tag Manager Code in Head
// =============================================================================
function my_custom_code1(){
?>

<?php } add_action( 'wp_head', 'my_custom_code1' ); // Add Google Tag Manager Code in Body // ============================================================================= function my_custom_code2(){ ?> <?php } add_action( 'x_before_site_begin', 'my_custom_code2' ); Any suggestions? Thanks

Hello @wowflak,

Thanks for asking. :slight_smile:

I suggest you to please try the solution mentioned in following thread and see how it goes:

A relatively easy approach to setup Google Tag manager would be to do via plugin. You can take a look at Google Tag Manager plugin. https://wordpress.org/plugins/google-tag-manager/#description

Please note that the name of plugin I have shared (Google Tag Manager) is not a official Themeco advice. It’s just a personal input that I have shared with you to help you get started. 3rd party plugins may cause some issues and we won’t be able to provide support in that scenario.

Thanks.

I actually did try that yesterday to no avail. I guess I can try the 3rd party…

Sure thing, let us know how it goes.

Thanks.

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