• Resolved ramonstyle

    (@ramonstyle)


    Hello,
    After last update to version 3.5.4 my pixel stop tracking all events for example i have 20 sales but she show to me only 2 sales only..
    I try to rollback to version 3.4.6. and i see now events tracking correctly any solutions?
    Also i see Events match quality is bad i have problems with Browsers ID and Click ID on almost all events
    Need also solution maybe someone can help to resolve?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Marija

    (@marijastuntcoders)

    Hi @ramonstyle – thank you for reaching out!

    Can you try the following:

    1. Temporarily disable all caching plugins and clear the cache
    2. Delete the Facebook for WooCommerce plugin and remove the Facebook for WooCommerce integration from your Business Tools
    3. Reinstall the plugin and reconnect to your page

    If the issue persists, please share your System Status report, the latest facebook_for_woocommerce log (located in WooCommerce > Status > Logs), and any plugin-related errors from your debug.log using PasteBin.

    Regarding the Event Match Quality, we have an update in the works that will improve Automatic Advanced Matching, and therefore the EMQ score (if AAM is enabled).

    Kind regards,
    Marija

    Thread Starter ramonstyle

    (@ramonstyle)

    Hello Marija,
    Thank you for your answer,
    With 3.4.6. version and other versions its works fine only with 3.5.4 version is not working correctly. Maybe i can wait for newest version 3.5.5. and then try to update maybe then everything works fine?

    Plugin Support Marija

    (@marijastuntcoders)

    Hi @ramonstyle ,

    Yes, we expect the Purchase event performance to improve with the next update. We will let you know once it has been released.

    Kind regards,
    Marija

    I have the same issue and i pinpointed the culprit.

    // Purchase and Subscribe events
    add_action( 'woocommerce_new_order', array( $this, 'inject_purchase_event' ), 10 );
    add_action( 'woocommerce_process_shop_order_meta', array( $this, 'inject_purchase_event' ), 20 );
    add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'inject_purchase_event' ), 30 );
    add_action( 'woocommerce_payment_complete', array( $this, 'inject_purchase_event' ), 40 );
    add_action( 'woocommerce_order_status_processing', array( $this, 'inject_purchase_event' ), 50 );
    add_action( 'woocommerce_order_status_completed', array( $this, 'inject_purchase_event' ), 60 );
    add_action( 'woocommerce_thankyou', array( $this, 'inject_purchase_event' ), 70 );

    The event is injected to multiple hooks however most of us want to inject it on the thank you page only. The issue is with the prevention of multiple trigger logic here:

    // use a session flag to ensure this Purchase event is not tracked multiple times
    $purchase_tracked_flag = '_wc_' . facebook_for_woocommerce()->get_id() . '_purchase_tracked_' . $order_id;

    // Return if this Purchase event has already been tracked or order state is invalid.
    if ( 'yes' === get_transient( $purchase_tracked_flag ) || $order->meta_exists( '_meta_purchase_tracked' ) || ! in_array( $order_state, $valid_purchase_order_states, true ) ) {
    return;
    }

    // Mark the order as tracked for the session.
    set_transient( $purchase_tracked_flag, 'yes', 45 * MINUTE_IN_SECONDS );

    // Set a flag to ensure this Purchase event is not going to be sent across different sessions.
    $order->add_meta_data( '_meta_purchase_tracked', true, true );

    // Save the metadata.
    $order->save();

    Basically it will fail the check once metadata is saved and that will happen on the first hook so your purchase event will never see the thank you page.

    I needed a temp fix and I commented out the following:

    add_action( 'woocommerce_new_order', array( $this, 'inject_purchase_event' ), 10 );
    add_action( 'woocommerce_process_shop_order_meta', array( $this, 'inject_purchase_event' ), 20 );
    add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'inject_purchase_event' ), 30 );
    add_action( 'woocommerce_payment_complete', array( $this, 'inject_purchase_event' ), 40 );
    add_action( 'woocommerce_order_status_processing', array( $this, 'inject_purchase_event' ), 50 );
    add_action( 'woocommerce_order_status_completed', array( $this, 'inject_purchase_event' ), 60 );

    and my Purchase event works on the thank you page

    Plugin Support Marija

    (@marijastuntcoders)

    Hi @stefanue – thanks for sharing the tip for other users on the forum.

    The update with the purchase event improvements will be landing soon, we will update this thread once it’s available.

    Kind regards,
    Marija

    Plugin Support Marija

    (@marijastuntcoders)

    Hi everyone, the update 3.5.5 has been released!

    Please update the plugin to the latest version, remove the connection/reconnect to your page, and re-test the events.

    Kind regards,
    Marija

    Thread Starter ramonstyle

    (@ramonstyle)

    Hi Marija,

    I update it plugin and then need disconnect plugin from fb and then reconnect?

    I just updated and gave it a test spin, however the purchase event is not tracked on the thank you page.

    in facebook-commerce-events-tracker.php a check exists:

    // use a session flag to ensure this Purchase event is not tracked multiple times
    $purchase_tracked_flag = '_wc_' . facebook_for_woocommerce()->get_id() . '_purchase_tracked_' . $order_id;


    // Return if this Purchase event has already been tracked.
    if ( 'yes' === get_transient( $purchase_tracked_flag ) || $order->meta_exists( '_meta_purchase_tracked' ) ) {
    return;
    }

    basically when the order is created it will add the meta and prevent the code being executed…

    I will try to find some time tomorrow to submit a PR that resolves this.

    Plugin Support Marija

    (@marijastuntcoders)

    Hi everyone, per this announcement, the plugin support is moving away from the Forum. Please use Meta Support instead.

    Kind regards,
    Marija

    • This reply was modified 10 months, 2 weeks ago by Marija.
Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Events not tracking after update’ is closed to new replies.