Analytics Order Line

Index order line analytics for sales reporting and analysis

Overview

This task indexes analytics for order line items, providing detailed sales data for reporting and business intelligence. It processes orders modified since the last run and creates analytics records for each order line.

Identifier

PropertyValue
Implementation TypeAnalyticsOrderLineScheduledTask
GroupAnalytics
TypeDelta

When to Use

Enable this task when you need:

  • Detailed sales reporting by product
  • Order line-level analytics
  • Revenue breakdown analysis
  • Product performance tracking

Configuration Properties

This task has no configurable properties.


Behavior

What It Does

  1. Checks if more than 5 days have passed since last run (skips if so)
  2. Retrieves orders modified since the last run (with 1-minute overlap for safety)
  3. Processes each order's line items
  4. Creates analytics records for reporting
  5. Supports cancellation for timeout management

Gap Protection

If more than 5 days have passed since the last successful run, the task will skip execution and return a success status with a message indicating the skip. This prevents excessive processing after extended downtime and protects system resources.

Prerequisites

  • Orders with line items must exist
  • Analytics indexing services must be configured

Side Effects

  • Updates the analytics order line index
  • Gaps may occur in analytics if the task doesn't run for more than 5 days

Lowest General Price and Extra Discount

Turn on Lowest general price in analytics under Order settings → Statistics and analytics (OrderSettings.IsAnalyticsLowestGeneralPriceEnabled, off by default). Order line indexing must also be on under Platform → Analytics. Each sales line then gets the price anyone could buy the item for on the order date, and the extra discount the line got below it. With a regular price of 1000, a campaign at 800 and an employee paying 600, the extra discount is 200.

Which Price Counts

The lowest general price is the price the cart would charge a customer club member with no customer prices, in the order's store.

Price on the productCounts
Base price, price list and campaign pricesYes
Customer club pricesYes
Promotion prices without a customer groupYes
Prices for the order's store or its store groupYes
Prices for other storesNo
Customer and customer group pricesNo
Prices from an external price serviceNo

Among the prices that count, the one the cart would charge wins: a price in the line's unit first, then the store's own price, then its store group's, then the lowest. Only the prices on the product are read (or the price index for tenants with separate prices), never the price lists themselves.

When It Is Looked Up

Order age at the line's first indexPrices usedSource
Up to 5 daysPrices valid on the order date, the base price includedCurrent
OlderPrices valid on the order date, the undated base price left outHistory
No price foundThe line's placed pricePlacedPrice
  • A line keeps the value from its first index. A reindex never changes it, also while the setting is turned off.
  • To fill older orders, turn the setting on and use Reindex now for order lines under Platform → Analytics. That action reaches at most 100 days back.
  • How far back campaign prices are found depends on how long expired prices stay on the products (DeleteExpiredPricesScheduledTask) and on the promotion cleanup task.
  • A return line takes the value of its sale line.

Fields

The fields are on the OrderLine object of an analytics order line, in custom reports for analytics order lines and in the public Analytics API.

FieldMeaning
LowestGeneralPrice, LowestGeneralPriceExclTaxThe lowest general price of one unit
LowestGeneralPriceDateWhen the price was looked up
LowestGeneralPriceSourceCurrent, History or PlacedPrice
LowestGeneralPriceTotal, LowestGeneralPriceTotalExclTaxThe price times the line's net quantity
ExtraDiscount, ExtraDiscountExclTax(lowest general price − price per unit after line discounts) × net quantity. 0 for a cancelled order, negative on a return line

Example Configuration

{
    "ImplementationType": "AnalyticsOrderLineScheduledTask",
    "Schedule": "*/10 * * * *",
    "IsDisabled": false
}

Run every 10-15 minutes (*/10 * * * *) to maintain current order line analytics. Ensure the task runs at least once within any 5-day period to avoid skipping.


On this page