Tagged: x
-
AuthorPosts
-
July 25, 2016 at 10:36 am #1102011
PatrickParticipantHello,
Can you please help me install the Facebook pixel base code to my child theme’s functions.php? I have read the instructions on this thread but am still not sure where the code should be pasted. I am assuming after the //Additional Functions line, but I’m not sure and don’t want to crash the site with a ppc campaign ongoing.
I will send you my login and the fb code if you can assist me.
Any feedback would be greatly appreciated.
Thanks!
July 25, 2016 at 10:40 am #1102017
PatrickParticipantThis reply has been marked as private.July 25, 2016 at 10:55 am #1102043
RahulModeratorHey there,
Make sure that you have downloaded the latest version of child theme (https://community.theme.co/kb/how-to-setup-child-themes/).
To setup Child theme properly, you need to follow this thread :
https://community.theme.co/kb/how-to-setup-child-themes/
Give it a try for once. If you are still facing any issues with it, let us know. We’d help you out!
Thanks for understanding.
July 25, 2016 at 11:32 am #1102112
PatrickParticipantThis reply has been marked as private.July 25, 2016 at 11:39 am #1102132
RahulModeratorHey There,
Once a child theme is setup, please add this code in the functions.php file:
function fb_pixel() { if(is_page(2484)){ ?> <!-- Your code will go here --> <?php } } add_action( 'wp_head', 'fb_pixel' );Please add your FB pixel code around the area <!– Your code will go here –>.
Hope this helps.
August 2, 2016 at 9:20 pm #1114818
milkshakerrrParticipantHello! Is it possible to add more than one pixel? Where would I input the subsequent pixel codes?
August 3, 2016 at 5:21 am #1115194
ThaiModeratorYes,
The code will be similar to this:
function fb_pixel() { if(is_page(2484)){ ?> <!-- Facebook Pixel Code 1 --> <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','//connect.facebook.net/en_US/fbevents.js'); // Insert Your Facebook Pixel ID below. fbq('init', 'FB_PIXEL_ID'); fbq('track', 'PageView'); </script> <!-- Insert Your Facebook Pixel ID below. --> <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=FB_PIXEL_ID&ev=PageView&noscript=1" /></noscript> <!-- End Facebook Pixel Code 1 --> <!-- Facebook Pixel Code 2 --> <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','//connect.facebook.net/en_US/fbevents.js'); // Insert Your Facebook Pixel ID below. fbq('init', 'FB_PIXEL_ID'); fbq('track', 'PageView'); fbq('track', 'AddToCart'); </script> <!-- Insert Your Facebook Pixel ID below. --> <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=FB_PIXEL_ID&ev=PageView&noscript=1" /></noscript> <!-- End Facebook Pixel Code 2 --> <?php } } add_action( 'wp_head', 'fb_pixel' );Hope it helps 🙂
October 14, 2016 at 11:27 pm #1217002
milkshakerrrParticipantThank you!
October 15, 2016 at 1:34 am #1217065
FriechModeratorYou’re more than welcome, glad we could help.
Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1102011 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
