Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1148230
    henrybag
    Participant

    If I was wanting to add google adwords tracking code to a page would it be best in the Custom Javascript section of Cornerstone? The page it relates to is http://screconomy.org.uk/register

    Thanks

    Henry

    #1148238
    henrybag
    Participant
    This reply has been marked as private.
    #1148490
    Darshana
    Moderator

    Hi there,

    Thanks for writing in! Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    Then add the following code into your child theme’s functions.php file and replace the following line with your JavaScript code provided by Google (<!-- Add Your Google Adwords JavaScript Code Here -->)

    
    function my_google_adwords_code() {    
    ?>
    
    <!-- Add Your Google Adwords JavaScript Code Here -->
    
    <?php }
    
    add_action( 'wp_footer', 'my_google_adwords_code', 99 );
    

    Hope that helps.

    #1154780
    henrybag
    Participant

    Hi

    Thanks for getting back to me – is there a way to target a specific page?

    Many thanks

    Henry

    #1154865
    Christopher
    Moderator

    Hi there,

    Yes, please add this code :

     function my_google_adwords_code() {    
    ?>
    <?php if (is_page( 37 )  ) : ?> 
    
    <!-- Add Your Google Adwords JavaScript Code Here -->
    <?php endif; ?>
    <?php }
    
    add_action( 'wp_footer', 'my_google_adwords_code', 99 );
    

    Instead of 37, add your page ID.

    Hope it helps.

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