• Resolved Firelight

    (@mdc2957)


    Hello, I’ve discovered that having ESI enabled causes intermittent issues with the Facebook pixel not getting triggered on the Woo purchase summary page. The developer of the plugin said it should work fine with ESI, but nevertheless, it’s not. Is there a way to exclude ESI from certain pages? I can’t see any exclusion text boxes specifically for ESI. Thank you

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support qtwrk

    (@qtwrk)

    add_action( 'litespeed_init', function() {

    if ( isset($_SERVER['REQUEST_URI']) && strpos($_SERVER['REQUEST_URI'], 'xxx') !== false ) {
    do_action( 'litespeed_conf_force', 'esi', 0 );
    }
    else {
    do_action( 'litespeed_conf_force', 'esi', 1 );
    }
    } );

    not sure if this works or not , but doesn’t hurt to try , please update the xxx to the URL that matches your target page

    Thread Starter Firelight

    (@mdc2957)

    Thank you for the reply, I will try it. If an example thank you page is:

    https://mydomain.com/purchase-summary/order-received/27972/?key=wc_order_e7zxFtvnsN6yV&nodedupe&pmwloggeron

    should I replace xxx in your snippet to:

    https://mydomain.com/purchase-summary/order-received/

    ?

    Plugin Support qtwrk

    (@qtwrk)

    partial match also works , for simplicity sake, you can just put order-received

    Thread Starter Firelight

    (@mdc2957)

    just order-received? In your previous message, you said to change xxx to the URL that matches the target page. Does it need to be a full URL or just the endpoint order-received ?

    Plugin Support qtwrk

    (@qtwrk)

    partial match also works , by that saying, order-received is enough , no other page would use this URL

    • This reply was modified 1 month, 1 week ago by qtwrk.
    Thread Starter Firelight

    (@mdc2957)

    Got it, thank you, I’ll give it a try!

    Thread Starter Firelight

    (@mdc2957)

    I’m not sure that the snippet works as the orders coming in still indicate that the facebook pixel on the purchase summary page wasn’t fired. Is there a way to check if ESI is disabled on the purchase summary page so I can at least see if the snippet works or doesn’t work?

    Thread Starter Firelight

    (@mdc2957)

    I think the following snippet is working. Pixel helper extension is showing both pageview and purchase, and I get the green check mark in the orders list after visiting those order summary pages, so I think it’s fixed!

    add_action('wp', function() {
        if (is_wc_endpoint_url('order-received')) {
            // Disable all caching for this page
            do_action('litespeed_control_set_nocache', 'woocommerce order received');
            
            // Disable ESI processing specifically
            add_filter('litespeed_esi_status', '__return_false');
        }
    }, 1);
Viewing 8 replies - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.