onpelikan Posted December 11, 2015 Share Posted December 11, 2015 Hi, Is there some tutorial for installing Facebook Pixel (not old conversion pixel)? Facebook pixel Code is in header section of all pages? Event code is only in relevant page? How to do that? Thank you very much Here are instructions from Facebook: Copy the code below and paste it between the <head> and </head> in your website code. You can add standard events from the list below to track specific actions people take on your website. To confirm installation, please use the Pixel Helper. Learn more in the Help Center. Facebook Pixel Code <!-- Facebook Pixel Code --> <script> !function(f,b,e,v,n,t,s){..... //there is function here fbq('init', '...'); fbq('track', "PageView"); </script> <noscript> <img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=xxxxxxxxx&ev=PageView&noscript=1" /> </noscript> <!-- End Facebook Pixel Code --> Standard events Add standard events to your code to track specific types of actions on your website. Copy the code for the type of event you want to measure, and paste it below the pixel code on the relevant page within a <script> tag. Learn more about conversion tracking. // ViewContent // Track key page views (ex: product page, landing page or article) fbq('track', 'ViewContent'); // Search // Track searches on your website (ex. product searches) fbq('track', 'Search'); // AddToCart // Track when items are added to a shopping cart (ex. click/landing page on Add to Cart button) fbq('track', 'AddToCart'); // AddToWishlist // Track when items are added to a wishlist (ex. click/landing page on Add to Wishlist button) fbq('track', 'AddToWishlist'); // InitiateCheckout // Track when people enter the checkout flow (ex. click/landing page on checkout button) fbq('track', 'InitiateCheckout'); // AddPaymentInfo // Track when payment information is added in the checkout flow (ex. click/landing page on billing info) fbq('track', 'AddPaymentInfo'); // Purchase // Track purchases or checkout flow completions (ex. landing on "Thank You" or confirmation page) fbq('track', 'Purchase', {value: '1.00', currency: 'USD'}); // Lead // Track when a user expresses interest in your offering (ex. form submission, sign up for trial, landing on pricing page) fbq('track', 'Lead'); // CompleteRegistration // Track when a registration form is completed (ex. complete subscription, sign up for a service) fbq('track', 'CompleteRegistration'); Link to comment Share on other sites More sharing options...
Bill Dalton Posted December 11, 2015 Share Posted December 11, 2015 That would go in your themes header.tpl Link to comment Share on other sites More sharing options...
onpelikan Posted December 12, 2015 Author Share Posted December 12, 2015 Ok, But what about events? It shloud be only on relevant page or not? Link to comment Share on other sites More sharing options...
Bill Dalton Posted December 12, 2015 Share Posted December 12, 2015 You can add all of those. The only one that may need to be on a separate page is // CompleteRegistration// Track when a registration form is completed (ex. complete subscription, sign up for a service)fbq('track', 'CompleteRegistration'); Depending on what payment options you offer the final payment page may be custom, or it could be that Facebook only wants that call to fire when that page is loaded. For example if you use a Gateway to take Credit cards, and additionally use PayPal, both of these payment processors use a different order confirmation page. Even if you use a third party one page checkout module you will need to find the final confirmation page it may use. Link to comment Share on other sites More sharing options...
onpelikan Posted December 13, 2015 Author Share Posted December 13, 2015 Thank you very much for your time. I know about different confirmation pages. Can you explain the reason of the events please? I thought that I have to fire event only on page that is relevant to goal, that I want to track. E. g. Search event only on page with search results Link to comment Share on other sites More sharing options...
Bill Dalton Posted December 13, 2015 Share Posted December 13, 2015 >>Can you explain the reason of the events please? onpelikan, the events look to be very self explanatory but you really should find a good Facebook forum for deeper understanding and from the horses mouth information. Link to comment Share on other sites More sharing options...
atomointeractive Posted June 23, 2016 Share Posted June 23, 2016 The way that i did it is through the Google Tag Manager.I just put the Google Tag Manager in Header.tpl using the {literal} tags mentioned before. Then in google tag manager I implemented the Facebook tag with the options in: "Tags > Custom HTML Tag", and activate it in all pages Then I created Tiggers for: Click on "Add to Cart Button""Add to Wishlist Button" According to these instructions: https://www.youtube.com/watch?annotation_id=annotation_1950112109&feature=iv&src_vid=YUKB-1Ay5lY&v=iaJ9HHvKeL8 Then i created new TAGS for each conversion. For "Add to cart" i used my add to cart Tigger For "Add to wish list" the same And for "Initiate checkout" the tigger is the page view: " order?step=1 " just this way: <script>fbq('track', 'InitiateCheckout');</script> I am still testing the "Make Purchase" tracking in "order-confirmation" page view, as i have to figure out how to enter the value of the pixel track<script>fbq('track', 'Purchase', {value: '0.00', currency: 'USD'});</script>I hope this hels, and i hope algo if you can help me with the Value of the purchase. Link to comment Share on other sites More sharing options...
REGI0 Posted July 22, 2016 Share Posted July 22, 2016 (edited) That would go in your themes header.tpl Hello i just add pixel code to my theme header file but after update my page showing HTTP ERROR 500 When I cut off this part: !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'); page is work again but this is necessary to work pixel. Please help resolve my issue Edited July 22, 2016 by REGI0 (see edit history) Link to comment Share on other sites More sharing options...
IvetaArnaudova Posted July 22, 2016 Share Posted July 22, 2016 Hello, I need some help too. I put the Facebook Pixel code in <head> section of the header.tpl but still nothing happens I also put the code in {literal}. What else do I have do to make my Facebook Pixel works. Link to comment Share on other sites More sharing options...
vekia Posted August 23, 2016 Share Posted August 23, 2016 i wrote guide about fb conversion pixel - you can read here how to add it with html box pro module, it will replace dynamic variables like value of order or currency 1 Link to comment Share on other sites More sharing options...
ulriknedergaard Posted September 22, 2016 Share Posted September 22, 2016 Hi REGI0 I came across this post having the same problem as you did. The server returns 500 error and blank page if I have the script in the head-section of my template. Did you solve it, and if so ..... how? I am using the default theme for now. Hello i just add pixel code to my theme header file but after update my page showing HTTP ERROR 500 When I cut off this part: !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'); page is work again but this is necessary to work pixel. Please help resolve my issue Link to comment Share on other sites More sharing options...
sfyk Posted September 29, 2016 Share Posted September 29, 2016 Just add the script in {literal} {/literal} brackets and you will get rid of error 500. Have a look here: <!-- Facebook Pixel Code --> {literal} <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', '1234567891234567799'); fbq('track', 'PageView'); </script> <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=1777628335836654&ev=PageView&noscript=1" /></noscript> {/literal} <!-- DO NOT MODIFY --> <!-- End Facebook Pixel Code --> Link to comment Share on other sites More sharing options...
pakiuh Posted December 10, 2016 Share Posted December 10, 2016 Perfect, Thank you for the idea Link to comment Share on other sites More sharing options...
tiendatutorial Posted May 21, 2017 Share Posted May 21, 2017 Hi, this tutorial is in Spanish but i very easy Link to comment Share on other sites More sharing options...
Recommended Posts