Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1312511
    epmarketweb
    Participant

    Hi X,

    1) I try to install GTM on my website. In many templates, we can access via Editor function within WordPress’s dashboard. However, when using a child theme, there aren’t many files available to edit from within the WordPress dashboard.

    I need to copy this code just after the opening <body> tag. Where is it?
    <?php if ( function_exists( ‘gtm4wp_the_gtm_tag’ ) ) { gtm4wp_the_gtm_tag(); } ?>

    2) With X updates, does it affect my tags?

    Thanks and happy new year 😉

    #1312512
    epmarketweb
    Participant
    This reply has been marked as private.
    #1312516
    epmarketweb
    Participant
    This reply has been marked as private.
    #1312521
    Christopher
    Moderator

    Hi there,

    #1 Please add following code in child theme’s functions.php file :

    function my_custom_footer_output() {
      ?>
        ...code here...
      <?php
    }
    
    add_action( 'wp_footer', 'my_custom_footer_output', 99999 );

    #2 No, since you’re using child theme your customization wont be overwritten during update.

    Hope it helps.

    #1312528
    Thai
    Moderator

    Hi There,

    Please add the following code under functions.php file locates in your child theme:

    add_action( 'x_before_site_begin', 'print_script_before_site_begin' );
    function print_script_before_site_begin(){
    	if ( function_exists( 'gtm4wp_the_gtm_tag' ) ) { 
    		gtm4wp_the_gtm_tag(); 
    	}
    }

    If you use child theme, your code will be safe with X updates.

    Regards!

    #1312644
    epmarketweb
    Participant
    This reply has been marked as private.
    #1312930
    Jade
    Moderator

    Hi there,

    I have checked and the GTM code seems to be added correctly on the site. The error might be something in the code on GTM.

    Please check this link for possible solution: https://wordpress.org/support/topic/invalid-or-missing-account-id/

    Hope this helps.

    #1313107
    epmarketweb
    Participant
    This reply has been marked as private.
    #1313636
    Christopher
    Moderator

    Hi there,

    I would like to check your site but it’s under construction mode, please provide us with login credentials.

    Thanks.

    #1314578
    epmarketweb
    Participant
    This reply has been marked as private.
    #1315274
    Christopher
    Moderator

    Hi there,

    Upon checking your site, google tag manager has been added successfully. See the attachment.

    Hope it helps.

  • <script> jQuery(function($){ $("#no-reply-1312511 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>