• Resolved nickfarelli

    (@nickfarelli)


    Hello,

    i have two code snippets in my website.

    <!– Facebook Pixel Code –>
    <noscript>
    <img
    height=”1″
    width=”1″
    style=”display:none”
    alt=”fbpx”
    src=”https://www.facebook.com/tr?id=230356148345705&ev=PageView&noscript=1&#8243;
    />
    </noscript>
    <!– End Facebook Pixel Code –>

    ——————————————————————————-

    AND ALSO THIS ONE

    <!– WooCommerce Facebook Integration Begin –>
    <script type=”text/javascript”>

    fbq(‘init’, ‘230356148345705’, {}, {
    “agent”: “woocommerce-4.8.0-1.11.4”
    });

    fbq( ‘track’, ‘PageView’, {
    “source”: “woocommerce”,
    “version”: “4.8.0”,
    “pluginVersion”: “1.11.4”
    } );

    document.addEventListener( ‘DOMContentLoaded’, function() {
    jQuery && jQuery( function( $ ) {
    // insert placeholder for events injected when a product is added to the cart through AJAX
    $( document.body ).append( ‘<div class=\”wc-facebook-pixel-event-placeholder\”></div>’ );
    } );
    }, false );

    </script>
    <!– WooCommerce Facebook Integration End –>

    ——————————————————————————-

    Is that normal? Or does that mean that all events are tracked twice?

    • This topic was modified 4 years, 2 months ago by nickfarelli.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @nickfarelli,

    The code you provided is normal and shouldn’t cause events to be tracked twice.

    You’ll see that the first snippet you provided contains noscript tags. Code contained with those tags will only fire on browsers with JavaScript disabled, while the code within the script tags will fire when JavaScript is enabled (which should account for the majority of browsers).

    You can find a bit more detail around how the noscript tag works here:

    https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript

    Hope that’s helpful!

    AJ a11n

    (@amandasjackson)

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Pixel double firing?’ is closed to new replies.