javascript - Facebook Pixel returns weird results -
i have installed new facebook pixel in website. strange, inconsistant results:
- in facebook ads manager, pixel appears active, can see traffic , everything...
- ... if check chrome pixel helper, see none of events load: of them return same error message: "the facebook pixel code on page didn't load, no information sent facebook";
- and in ads manager, when run test campaign, pixel tells me got amount of conversions, add-to-carts, etc. , yet, not true: did not receive purchase @ all!
so basically, messed in facebook script makes my pixel return results not correspond reality. have idea of reason problem? many in advance.
my store running magento ce 1.9.0.1 , here facebook-generated pixel code have copied in app/design/frontend/shopper/default/template/page/html/head.phtml
:
<!-- 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','//connect.facebook.net/en_us/fbevents.js'); fbq('init', '119809338361519'); fbq('track', "pageview"); fbq('track', 'viewcontent'); fbq('track', 'addtocart'); fbq('track', 'initiatecheckout'); fbq('track', 'purchase', {value: '0.00', currency: 'eur'}); fbq('track', 'completeregistration'); </script> <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=119809338361519&ev=pageview&noscript=1" /></noscript> <!-- end facebook pixel code -->
i facing similar issue. these changes resolved issue:
<head> !-- facebook pixel code --> .... .... .... <!-- end facebook pixel code --> </head> <script> fbq('track', 'viewcontent'); fbq('track', 'addtocart'); fbq('track', 'initiatecheckout'); fbq('track', 'purchase', {value: '0.00', currency: 'eur'}); fbq('track', 'completeregistration'); </script>
summary: view source code of page. ideally facebook pixel code (as provided facebook) should within tags. whereas tracking code should outside it. hence have copied tracking code directly body of respective page. after no more getting error.
Comments
Post a Comment