badget

Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

Implementing Google Tag manager

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #54026
    mail25
    Participant

    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?

    #54037

    hi 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!

    #54041
    mail25
    Participant

    The 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 customize

    #54042

    HI 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!

    #54081
    stellafrancis255
    Participant

    Nice Post. Thanks for Sharing

    #54083

    Welcome anytime @stellafrancis255

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.