Tagged: google tag manager
- This topic has 5 replies, 4 voices, and was last updated 7 years ago by Theme Horse Support Team.
-
AuthorPosts
-
November 11, 2017 at 10:42 am #54026mail25Participant
I use DuracellTomi’s Google Tag Manager for WordPress. But Google Search Console does not accept the container code placement at the Footer of the page for verification anymore. Error message: “The Google Tag Manager snippet on your site is in the wrong location”
Can you tell me how can I edit my template file and use the ‘Custom’ placement and add the following line just after the opening <body> tag:
<?php if ( function_exists( ‘gtm4wp_the_gtm_tag’ ) ) { gtm4wp_the_gtm_tag(); } ?>Or alternatively should I follow these instructions from Google?
https://developers.google.com/tag-manager/quickstart
But how can I place these on every page of my website?November 13, 2017 at 4:38 am #54037Theme Horse Support TeamKeymasterhi mail25,
Go to theme folder > haeader.php and you will see
do_action( 'attitude_before' );
code on line no 53. You can add your code just before this line to display your code in header and the added code will be displayed in every page of your website.We recommended you not to change the code. If you need to customize the code then we recommended you to create a child theme and use this hook
do_action( 'attitude_before' );
and add your action into your functions.php of child theme. So that while updating to new version your customized code will not be lost.Otherwise each and every time while updating to new version same code customization is required in header.php
Thank you!
November 13, 2017 at 9:09 am #54041mail25ParticipantThe problem is I can’t find the header.php. I found in the Appearance folder:
– Editor, with templates, e.g.: •Theme Functions(functions.php)
– Customize, webmaster tools: Code to display on Header
– Header, which redirected me to Header image in customizeNovember 13, 2017 at 10:37 am #54042Theme Horse Support TeamKeymasterHI mail25,
You header file is located at themefolder > header.php. Don’t make code customization from appearance -> editor. While customizing the code all your customized code will be lost. So child theme is required to be safe from data loss while updating to new version.
The path location of headr.php is first you need to login to your ftp account and inside public_html -> wp-content -> themes -> attitude -> header.php.
Thank you!
November 17, 2017 at 5:29 am #54081stellafrancis255ParticipantNice Post. Thanks for Sharing
November 17, 2017 at 6:27 am #54083Theme Horse Support TeamKeymasterWelcome anytime @stellafrancis255
-
AuthorPosts
- You must be logged in to reply to this topic.