Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1196822
    John B
    Participant

    my goal you need to edit your template file and add the following line just after the opening <body> tag:
    <?php if ( function_exists( ‘gtm4wp_the_gtm_tag’ ) ) { gtm4wp_the_gtm_tag(); } ?>

    after researching the forum I added the code into the functions.php file in staging and it greaks. says error on line 31.

    Is that the right place to put that code?

    thank you

    #1196927
    Paul R
    Moderator

    Hi,

    You can try this code instead.

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

    You may add it in your child theme’s functions.php file after this line.

    // Additional Functions
    // =============================================================================

    Hope that helps.

    #1197131
    John B
    Participant

    hi good to hear from you and thank you for your prompt response.

    no luck I get

    HTTP response code indicates tag failed to fire: Status 404. This could be due to an empty or un-published container

    http://bigcatmarketin.staging.wpengine.com/state-of-the-propane-and-heating-oil-industry/

    heres what it looks like

    // Additional Functions
    // =================================tagmanager========================================

    function add_gtm_tag(){
    if ( function_exists( ‘gtm4wp_the_gtm_tag’ ) ) { gtm4wp_the_gtm_tag(); }
    }
    add_action(‘x_before_site_begin’, ‘add_gtm_tag’);

    // ==================================woocommercedirect2order===========================================

    add_filter (‘woocommerce_add_to_cart_redirect’, ‘woo_redirect_to_checkout’);
    function woo_redirect_to_checkout() {
    $checkout_url = WC()->cart->get_checkout_url();
    return $checkout_url;
    }

    I am using https://duracelltomi.com/google-tag-manager-for-wordpress/
    thats where I saw the original code i mentioned
    suggestions?

    #1197239
    Paul R
    Moderator

    Hi,

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    #1197289
    John B
    Participant
    This reply has been marked as private.
    #1197797
    Rad
    Moderator

    Hi there,

    What’s your admin login credentials? Your site is behind a coming soon page and I can;t directly your page.

    Thanks!

    #1197831
    John B
    Participant
    This reply has been marked as private.
    #1198157
    John B
    Participant

    site should be propogated for bigcatmarketinggroup.com and staging is good to go. so you should have full access

    thank you

    #1198173
    Rue Nel
    Moderator

    Hello There,

    The code is working correctly. It is showing right after the <body> tag.

    Further inspection of the page, there seems to be a JS error on the page. You can check it here: http://prntscr.com/coeym4
    You could try testing for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

    Please let us know how it goes.

    #1198674
    John B
    Participant

    got it

    thank you

    #1198983
    Rue Nel
    Moderator

    You’re welcome!
    We’re glad we were able to help you out.

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