• Resolved Yan Knudtskov

    (@yannielsen)


    Dear Klaviyo Support

    We’re seeing a very high volume of webhooks triggered for order.update to klaviyo, currently around 6.000 per hour (100 per minute) or equivalent to 144.000 per day, which is high than even the total number of orders on the site.

    It results in a build up of data in the wp_action_scheduler_actions and wp_action_scheduler_logs tables and we discovered around 4-5GB of data solely from this.

    It looks like the webhook is being triggered excessively but we can’t see more than this from the data than the webhook is being triggered.

    Is this something that has been reported before and if so is there a fix for it?

    Kind Regards 😊

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Scott (Klaviyo)

    (@scottklaviyo)

    Thanks for reaching out @yannielsen . Klaviyo’s plugin does not trigger order updates. Klaviyo’s WooCommerce integration only subscribes to order-related webhooks via the order.update topic, note that this subscription is managed outside of the plugin.

    If you’re seeing an excessive number of order updates I would recommend investigating other plugins that might manipulate orders directly. These updates trigger the webhooks to Klaviyo and are causing a backup in the Action Scheduler.

    If you wish to pause webhook sending for the order.update topic you may do so manually under WooCommerce > Settings > Advanced > Webhooks. Please note, this may delay order-related events (Placed Order, Ordered Product, etc.) from being recorded in your Klaviyo account as these will instead be saved via periodic sync every 60 minutes.

    Don’t hesitate to reach out if you have any further questions.

    Thread Starter Yan Knudtskov

    (@yannielsen)

    Hi @scottklaviyo

    Thank you for you reply, we wen digging a bit futher and found the cause of the issue seemed to be an underlying bug in WooCommerce Subscription where subscriptions that were cancelled got called again and again with order updates.

    We were able to locate the Stack Trace of it through this method:

    add_action('woocommerce_update_order', 'yanco_woocommerce_update_order', 10, 1);
    function yanco_woocommerce_update_order($order_id)
    {
    $wc_logger = wc_get_logger();
    $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 20);
    $formatted_trace = '';
    foreach ($trace as $i => $frame) {
    $file = isset($frame['file']) ? $frame['file'] : '';
    $line = isset($frame['line']) ? $frame['line'] : '';
    $function = isset($frame['function']) ? $frame['function'] : '';
    $class = isset($frame['class']) ? $frame['class'] : '';
    $formatted_trace .= "#$i $file($line): $class$function()\n";
    }

    $wc_logger->debug(
    "Order #$order_id updated",
    array(
    'stack' => $formatted_trace,
    'source' => 'order_update_debug',
    'order_id' => $order_id,
    'action' => 'woocommerce_update_order',
    )
    );
    }

    This should not be left running for a long time as it can log quite a bunch of data on a system that has a lot of subscriptions on it 😅

    Plugin Support Scott (Klaviyo)

    (@scottklaviyo)

    Thanks for following up, @yannielsen . I’m glad you were able to locate the source of the excessive order updates and thanks for sharing your debugging process.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Webhook order.update’ is closed to new replies.