• Resolved wilde

    (@avz)


    Hi there,

    We would like to add the code of our FB pixel to the ‘script centrum’ but somehow the code seems incorrect:

    <!– 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&#8217;);
    fbq(‘init’, ‘XXXX’);
    fbq(‘track’, ‘PageView’);
    </script>
    <noscript><img height=”1″ width=”1″ style=”display:none”
    src=”https://www.facebook.com/tr?id=494033691224389&ev=PageView&noscript=1&#8243;
    /></noscript>
    <!– End Facebook Pixel Code –>

    Could you let us know what we are doing wrong here?

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Leon Wimmenhoeve

    (@leonwimmenhoeve)

    Hi @avz,

    you can paste the following into the Script Center:

    !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’, ‘XXXX’);
    fbq(‘track’, ‘PageView’);

    You were very close 🙂

    Please let me know if this works.

    Regards,
    Leon

    Thread Starter wilde

    (@avz)

    Thanks!

    Could this result in a conflict with the plugin Autoptimize?
    Our site shows some difficulties now, shutting down Autoptimize fixes it. But slows down our site.

    If you have “also aggregate inline JS” on, then try with that disabled or alternatively add _fbq to the comma-separated list of JS optimization exclusions. If the difficulties persist after you’ve done that, then the problem is elsewhere in AO’s configuration and you might want to go through the troubleshooting tips in AO’s FAQ.

    Plugin Contributor Leon Wimmenhoeve

    (@leonwimmenhoeve)

    @optimizingmatters Thanks again for the prompt support!

    Thread Starter wilde

    (@avz)

    Thanks, both. I will try this.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘FB Pixels’ is closed to new replies.