Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #383014

    mlsuffo
    Participant

    Thank you – I was working from post #379289.

    So to clarify it should look like this – and this works.

    // Additional Functions
    // =============================================================================
    
    // Add Google Tag Manager Code
    // =============================================================================
    function add_google_tag_manager_code(){
    ?>
    
    <!-- Google Tag Manager -->
    
    YOUR CODE HERE
    
    <!-- End Google Tag Manager -->
    
    <?php 
    }
    add_action( 'x_before_site_begin', 'add_google_tag_manager_code' );
    // End Add Google Tag Manager Code
    // =============================================================================
    #383017

    Christopher
    Moderator

    Thanks for sharing.

    #387577

    CSPCXtheme
    Participant

    Hi, Ive just tried to add the code snippet you advised and added ‘x_before_site_begin’ and now am completely locked out of my site, and cannot access the wp-admin page. Please help.

    #387697

    Rue Nel
    Moderator

    Hello There,

    Thanks for updating this thread! Would you mind providing us with login credentials so we can take a closer look? This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything. 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.

    Thank you.

    #387813

    CSPCXtheme
    Participant
    This reply has been marked as private.
    #387830

    Christopher
    Moderator

    Hi there,

    You need to revoke previous API key and regenerate it with your new domain. See : https://theme.co/community/kb/product-validation/
    Please setup a child theme and then add provided code in functions.php file.

    Hope it helps.

    #612370

    RichV
    Participant
    This reply has been marked as private.
    #612455

    Lely
    Moderator

    Hello Rich,

    If you tried above code on this reply:https://community.theme.co/forums/topic/wherehow-to-install-google-tag-manager-code-using-child-theme/page/2/#post-383014 on functions.php file of your child theme, please make sure that child theme is active via Appearance > Themes. I did check and the child theme is not active right now, unless you have just switch to main X theme.
    If you have done that and still doesn’t work, please also share your FTP credentials so we can check further. Thank you.

    #612502

    RichV
    Participant

    *slaps forehead*

    Thanks, it’s working now.

    #612527

    Christopher
    Moderator

    You’re welcome.