Overview
Behavioral metrics let you define computed aggregations over a customer’s interaction history. They transform raw event data (impressions, clicks, conversions) into meaningful signals like “email frequency in the last 7 days” or “conversion rate for credit card offers.” You use these metrics to power dynamic rules in contact policies, qualification, and scoring.Field Reference
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | Yes | — | Display name (1-100 characters) |
description | string | No | "" | Human-readable description (max 500 characters) |
aggregateFunction | enum | Yes | — | Aggregation method: count, sum, avg, min, max, ratio |
sourceField | enum | Yes | — | Outcome field to aggregate: impressions, positive, negative, neutral, converts, totalValue |
windowDays | number | No | null | Rolling lookback window in days (1-365). Null means all-time |
groupByDimensions | enum[] | No | [] | Grouping dimensions (max 2): offerId, channelId, creativeId, outcomeType |
filterConditions | object | No | — | Nested filter with and/or logic and field-level operators (eq, neq, gt, gte, lt, lte, in, not_in, contains) |
computeMode | enum | No | realtime | How the metric is computed: realtime or batch |
batchIntervalMin | number | No | — | Minutes between batch recomputations (5-1440, only used when computeMode is batch) |
status | enum | Auto | active | Metric status: active, paused, archived |
Aggregation Functions
| Function | Description | Example |
|---|---|---|
count | Number of matching records | ”3 impressions in 7 days” |
sum | Sum of the source field value | ”Total spend from conversions” |
avg | Average of the source field value | ”Average order value” |
min | Minimum value | ”Lowest offer amount clicked” |
max | Maximum value | ”Highest offer amount converted” |
ratio | Ratio of two event types | ”Click-to-impression ratio” |
The
ratio aggregation function requires a secondary event type. For example, a click-through rate metric would use positive (clicks) as the source field and compute the ratio against impressions.Source Fields
ThesourceField determines which column of the outcome/interaction record is aggregated:
| Source Field | Description |
|---|---|
impressions | Count of impression events |
positive | Positive outcomes (clicks, opens) |
negative | Negative outcomes (dismissals, unsubscribes) |
neutral | Neutral outcomes (views without action) |
converts | Conversion events |
totalValue | Monetary value associated with conversions |
Dimensions
Dimensions control how the metric is grouped. You can specify up to 2 dimensions:| Dimension | Description |
|---|---|
offerId | Group by specific offer |
channelId | Group by delivery channel (email, push, sms, etc.) |
creativeId | Group by creative variant |
outcomeType | Group by outcome type (impression, click, conversion, etc.) |
- No dimensions: “Total clicks in 7 days” (single number per customer)
channelIddimension: “Clicks per channel in 7 days” (one number per channel per customer)channelId+offerIddimensions: “Clicks per channel per offer in 7 days”
Time Window
ThewindowDays parameter defines the rolling lookback period:
- Minimum: 1 day
- Maximum: 365 days
- Set to
nullor omit for an all-time aggregation - The window is always rolling — it looks back from the current moment
Compute Modes
Behavioral metrics support two compute modes that control freshness and performance characteristics:Realtime Mode
WhencomputeMode is realtime, the metric is recomputed on every decision request. The engine queries the interaction history at decision time, applies the aggregation, and returns the current value.
- Freshness: Always up to date (includes events recorded moments ago)
- Performance cost: Higher latency per decision request, especially for large interaction histories
- Best for: Low-volume metrics, critical frequency caps, metrics that need sub-minute accuracy
Batch Mode
WhencomputeMode is batch, the metric is precomputed on a schedule defined by batchIntervalMin. A background worker periodically aggregates all interaction data and stores the result. At decision time, the engine reads the precomputed value instead of querying raw events.
- Freshness: Stale by up to
batchIntervalMinminutes - Performance cost: Near-zero latency at decision time
- Best for: High-volume metrics, long windows (90+ days), metrics where slight staleness is acceptable
| Compute Mode | Freshness | Decision-Time Cost | Use Case |
|---|---|---|---|
realtime | Instant | Higher | Frequency caps, real-time suppression |
batch | Up to N minutes stale | Near-zero | Lifetime value, 90-day conversion rates |
The
batchIntervalMin field is only used when computeMode is batch. Valid values are 5 to 1440 minutes (5 minutes to 24 hours).How Metrics Feed into Rules
Behavioral metrics are referenced in two key places during the decision pipeline:In Qualification Rules (metric_condition)
A qualification rule of typemetric_condition evaluates a behavioral metric against a threshold to determine whether an offer qualifies for a customer. The MetricConditionConfig specifies:
| Field | Type | Description |
|---|---|---|
metricId | string | UUID of the behavioral metric to evaluate |
operator | enum | Comparison: gt, gte, lt, lte, eq |
threshold | number | Value to compare the metric against |
dimensionMapping | object | Maps metric dimensions to the current context (e.g., { "offerId": "{{offer.id}}" }) |
In Contact Policies
Contact policies reference metrics to enforce frequency caps and fatigue detection:Limits
Creating a Behavioral Metric
Select source field
Choose the outcome field to aggregate (impressions, positive, negative, neutral, converts, totalValue).
Choose compute mode
Select
realtime for always-fresh values or batch for precomputed values with a refresh interval.Add filter conditions (optional)
Define filter conditions to narrow which interaction records are included in the aggregation.
Recipes
Common behavioral metric patterns for real-world use cases:- Frequency Cap
- Conversion Cooldown
- Channel Fatigue
- Response Rate Gate
- High-Value Targeting
- Cross-Sell Detection
Metric: Count of impressions per channel in 7 daysUsage: Create a contact policy that suppresses offers when
channel_impression_7d > 3 for any channel.API Reference
Create a Behavioral Metric
List Behavioral Metrics
Update a Behavioral Metric
Delete a Behavioral Metric
Next Steps
Algorithms & Models
Use behavioral metrics as features in scoring models.
Dashboards
Monitor metric values and trends in real time.