Tagged: x
-
AuthorPosts
-
August 14, 2016 at 5:31 am #1130674
Jodi DParticipantHi there
Despite scouring numerous knowledgebase questions already asked, I can’t figure out why my Facebook Pixel isn’t working.
Here is the contents of my child theme’s functions.php file:
<?php // ============================================================================= // FUNCTIONS.PHP // ----------------------------------------------------------------------------- // Overwrite or add your own custom functions to X in this file. // ============================================================================= // ============================================================================= // TABLE OF CONTENTS // ----------------------------------------------------------------------------- // 01. Enqueue Parent Stylesheet // 02. Additional Functions // ============================================================================= // Enqueue Parent Stylesheet // ============================================================================= add_filter( 'x_enqueue_parent_stylesheet', '__return_true' ); // Additional Functions // ============================================================================= // Add Facebook custom audience pixel Code // ============================================================================= function add_facebook_audience_pixel_code(){ ?> <!-- Insert Facebook custom audience pixel Code starts here --> <!-- Facebook Pixel Code --> <script> !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod? n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n; n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0; t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, document,'script','https://connect.facebook.net/en_US/fbevents.js'); fbq('init', '1189970867726547'); fbq('track', "PageView");</script> <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=1189970867726547&ev=PageView&noscript=1" /></noscript> <!-- End Facebook Pixel Code --> <!-- Insert Facebook custom audience pixel Code Code ends here --> <?php } add_action( 'wp_head', 'add_facebook_audience_pixel_code' ); // End Facebook custom audience pixel Code // ============================================================================= // Add Google Analytics Tracking code // ============================================================================= add_action( 'wp_head', 'x_google_code' ); function x_google_code(){ ?> <!-- Your Google Analytics Code Go Here --> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-51872828-1', 'auto'); ga('send', 'pageview'); </script> <?php }Can you please tell me what I’ve done wrong?
Thank you
Jodi
August 14, 2016 at 5:59 am #1130703
ChristianModeratorHey Jodi,
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 credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thanks.
August 15, 2016 at 9:48 pm #1132897
Jodi DParticipantThis reply has been marked as private.August 16, 2016 at 2:45 am #1133137
ChristopherModeratorHi there,
Please activate child theme.
Thanks.
August 16, 2016 at 4:19 am #1133215
Jodi DParticipantThis reply has been marked as private.August 16, 2016 at 7:37 am #1133443
LelyModeratorYou’re welcome Jodi!
Yes, any customization you made on the child theme will not work if i is not activated.
Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1130674 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
