Analytics

Order Sync History

3min

As shown in the Order View screen, a history of sync actions performed for this order is retained. History items are saved to the klevu_sync_order_history database table and contain the following information

  • Date and time the action was performed
  • What action was taken (for example, queueing for sync; starting processing)
  • The initiator of the action (for example, the Order save event; CLI command)
  • Whether the action completed successfully
  • A JSON-encoded string of additional information. This information varies based upon the action performed; initiator; etc, but generally will contain the following details
    • The Magento order id
    • The Magento store id
    • Sync status before the action was performed
    • Sync status after the action completed

Pruning History Records

By default, all history records are retained indefinitely. For stores with high order volume, this may introduce performance and storage concerns and the number of records builds up. As such, the module can be configured to prune old records automatically.

To enable order history pruning, enter values in one or both of the following configuration settings

  • Klevu > Developer Settings > Order Analytics > Remove History for Successfully Synced Orders After (days)
  • Klevu > Developer Settings > Order Analytics > Remove History for Failed Synced Orders After (days)

These values will determine the number of days for which to hold onto sync history for orders in the following statuses respectively: “complete”, “error”. Orders which are still pending synchronisation (including those which have been requeued) will not have history records removed. Note, this setting is global, meaning you cannot configure different thresholds based upon store.

Sync history is pruned based upon the timestamp of the history item, not the order date, meaning orders where processing spans multiple days may show partial history.

Sync history pruning is performed by the klevu_analytics_remove_synced_order_history cron job, which is scheduled to run at midnight each day.

Updated 18 Sep 2024
Doc contributor
Doc contributor
Did this page help you?