Add Stats Customers
Queue changed customers for asynchronous statistics processing
Overview
This task identifies customers that have been created or modified (including those with changed orders) and adds them to the statistics processing queue. It enables customer lifetime value calculations, purchase pattern analysis, and customer segmentation.
Identifier
| Property | Value |
|---|---|
| Implementation Type | AddStatsCustomersScheduledTask |
| Group | Analytics |
| Type | Delta |
When to Use
Enable this task when you need:
- Customer lifetime value (CLV) calculations
- Purchase pattern analysis
- Customer segmentation and scoring
- Customer-level reporting and analytics
Configuration Properties
This task has no configurable properties, but requires a tenant setting to be enabled.
Required Setting
This task only runs if the "Use Stats Customer Queues" feature is enabled in tenant settings. If this setting is not enabled, the task will return success without processing any data.
Behavior
What It Does
- Checks if stats customer queues feature is enabled
- Finds customers created or modified since the last run
- Finds orders modified since the last run and extracts their customer IDs
- Combines and deduplicates the customer lists
- Adds all affected customers to the statistics queue
Customer Detection
The task detects customers needing statistics updates through two mechanisms:
- Direct changes: Customers whose profile was created or modified
- Order changes: Customers who have orders that were modified (captures purchase activity)
Prerequisites
- "Use Stats Customer Queues" feature must be enabled in tenant settings
- Customer and order data must exist in the system
Side Effects
- Adds entries to the stats customer queue
- Queue will grow if processing cannot keep up with changes
Example Configuration
Recommended Schedule
Run every 5 minutes (*/5 * * * *) to keep customer statistics current. Align schedule with the Add Stats Orders task for consistent processing.
Related Tasks
- Add Stats Orders - Order statistics queue
- Reindex All Stats Customers - Full customer stats rebuild
