facebook pixel

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
8 years ago
Thx Guys! :)

I hope someone add plugin with this in new releases :)
8 years ago
Mr.Andrei,
From my previous experience I have to use this code in home,category and menufacture page. Otherwise facebook banned my clients ad.

<!-- 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', '0000000000000000');
fbq('track', 'PageView');
</script>
<noscript>
    <img height="1" width="1" style="display:none"
         src="https://www.facebook.com/tr?id=0000000000000000&ev=PageView&noscript=1" />
</noscript>
<!-- End Facebook Pixel Code -->
7 years ago
do you have any idea why they banned?
7 years ago
Hi )) I am using Nopcommerce 3.5, so I follow the installation like it described here and Facebook Pixel helper found two working pixels - ok. But product catalog is giving the errors for AddToCart, ViewContent and Purchase event is missing ...


Missing content_type parameter from "AddToCart" in EcoFilters
Required parameter content_type is missing from AddToCart events
To fix this:
Make sure the pixel code is installed correctly in your website
Make sure the event is sending all the required params: content_ids, content_type. Learn more
For Facebook Pixel you can download the Facebook Pixel Helper for Google Chrome to debug your pixel fires

Maybe someone already fixed it?
Thx.
6 years ago
Hi everyone,

Tanks to Mr. anik1991 I put the pixel code to every view, but when I put the edited files on my server nothing happens and I checked that the pixel code is missing. Probably whole nopcommerce should recompile or something similar. Can you please tell me how to do it apply the changes made in the view files.

Thank you for the help in advance!
6 years ago
Hello-

The facebook pixel code can be easily added to the Google Analytics plugin configuration if you are also using it.


admin >> Configuration >> Plugins >> Local Plugins >> Google Analytics

FIRST SECTION:



// ==================================
// this is bing pageview tracking for all pages of website if you use Bing..
// ==================================
(function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:"########"};o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad")},n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function(){var s=this.readyState;s&&s!=="loaded"&&s!=="complete"||(f(),n.onload=n.onreadystatechange=null)},i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)})(window,document,"script","//bat.bing.com/bat.js","uetq");

// ==================================
// this is facebook pageview tracking for all pages of website
// ==================================
(function() {
var _fbq = window._fbq || (window._fbq = []);
if (!_fbq.loaded) {
var fbds = document.createElement('script');
fbds.async = true;
fbds.src = '//connect.facebook.net/en_US/fbds.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(fbds, s);
_fbq.loaded = true;
}
_fbq.push(['addPixelId', '##################']);
})();
window._fbq = window._fbq || [];
window._fbq.push(['track', 'PixelInitialized', {}]);

// ==================================
// this is the google pageview tracking for all pages of website
// ==================================
    (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','//www.google-analytics.com/analytics.js','ga');
    ga('create', '{GOOGLEID}', 'auto');
    


SECOND SECTION:


{DETAILS}
// ==================================
// this is the checkout pageview for Google Analytics
// ==================================
ga('send', 'pageview');

// ==================================
// this is facebook conversion tracking for campaigns at Facebook
// ==================================
(function() {
  var _fbq = window._fbq || (window._fbq = []);
  if (!_fbq.loaded) {
    var fbds = document.createElement('script');
    fbds.async = true;
    fbds.src = '//connect.facebook.net/en_US/fbds.js';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(fbds, s);
    _fbq.loaded = true;
  }
})();
window._fbq = window._fbq || [];
window._fbq.push(['track', '############', {'value':'{TOTAL}','currency':'USD'}]);

// ==================================
// this is bing conversion tracking if you have campaigns at Bing
// ==================================
window.uetq = window.uetq || [];
window.uetq.push({ 'gv': {TOTAL} });

// ==================================
// this is google conversion tracking for your AdWords campaigns
// ==================================
/* <![CDATA[ */
var google_conversion_id = ##########;
var google_conversion_language = "en_US";
var google_conversion_format = "1";
var google_conversion_color = "ffffff";
var google_conversion_label = "###############";
var google_conversion_value = {TOTAL};
var google_conversion_currency = "USD";
var google_remarketing_only = false;
/* ]]> */



Or there is a plugin which allows you to add it and any other tracking script to your site very easily:
https://www.nopcommerce.com/p/2707/tracking-code-manager-facebook-pixel-google-tag-manager-google-customer-reviews-tradetracker-etc-foxnetsoftcom.aspx
6 years ago
Hello embryo and thank you a lot for the answer. I am using google analytics plugin so probably it should work.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.