Tagged: x
-
AuthorPosts
-
June 27, 2016 at 2:31 pm #1062038
Hello,
I need to add the following JS code to one of my pages:
ga(‘set’, ‘dimension1’, ’Monthly 14.95’);
ga(‘send’, ‘event’, ‘AB’, ‘View’, ‘PricingCampaign’);I tried the method of opening the page in Cornerstone, then I clicked on the gear icon in the top of the left column, then I clicked on CUSTOM JS and added the code there and saved it.
When I open the page in my browser and view the page source, the code is not there. Am I missing something?
The page is http://petpace.com/summer/
Stack: Renew
WordPress 4.5.3 running X – Child Theme
X Version: 4.5.2
Cornerstone Version 1.2.4June 27, 2016 at 6:48 pm #1062345Hi there,
Thanks for writing in! Please go through the following thread for examples (https://community.theme.co/forums/topic/adding-external-javascript-to-a-single-page/).
Hope that helps.
June 28, 2016 at 9:46 am #1063305Actually that does not help me. Can you please explain what the CUSTOM JS section is for in Cornerstone? Isn’t that where my custom js code should go? Pointing me to an article from 2014 does not help me. Thanks
June 28, 2016 at 9:58 am #1063329Hey There,
Please add the following code under functions.php file locates in your child theme:
add_action( 'wp_head', 'x_wp_head' ); function x_wp_head(){ if(is_page( 6349 )){ ?> <script type="text/javascript"> ga('set', 'dimension1', 'Monthly 14.95'); ga('send', 'event', 'AB', 'View', 'PricingCampaign'); </script> <?php } }
Hope it helps 🙂
-
AuthorPosts