Tagged: x
-
AuthorPosts
-
August 26, 2016 at 9:10 am #1148230
henrybagParticipantIf 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
August 26, 2016 at 9:11 am #1148238
henrybagParticipantThis reply has been marked as private.August 26, 2016 at 11:58 am #1148490
DarshanaModeratorHi 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.
August 31, 2016 at 4:09 am #1154780
henrybagParticipantHi
Thanks for getting back to me – is there a way to target a specific page?
Many thanks
Henry
August 31, 2016 at 5:35 am #1154865
ChristopherModeratorHi 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.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1148230 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
