Skip to main content

Overview

Behavioral metrics are 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.” These metrics power dynamic rules in contact policies, qualification, and scoring.

Key Fields

FieldTypeDescription
namestringDisplay name
keystringUnique machine-readable identifier
aggregationTypeenumHow events are aggregated
eventTypestringThe outcome type to aggregate (from outcome types)
dimensionsstring[]Grouping dimensions (max 2)
windowDaysnumberRolling time window in days (1-365)
descriptionstringHuman-readable description

Aggregation Types

TypeDescriptionExample
countNumber of matching events”3 impressions in 7 days”
sumSum of a numeric property on events”Total spend from conversions”
avgAverage of a numeric property”Average order value”
minMinimum value”Lowest offer amount clicked”
maxMaximum value”Highest offer amount converted”
ratioRatio of two event types”Click-to-impression ratio”
The ratio aggregation type requires a secondary event type. For example, a click-through rate metric would use click as the primary event and impression as the secondary event: count(click) / count(impression).

Dimensions

Dimensions control how the metric is grouped. You can specify up to 2 dimensions:
DimensionDescription
channelGroup by delivery channel (email, push, sms, etc.)
offerGroup by specific offer
Examples:
  • No dimensions: “Total clicks in 7 days” (single number per customer)
  • channel dimension: “Clicks per channel in 7 days” (one number per channel per customer)
  • channel + offer dimensions: “Clicks per channel per offer in 7 days”

Time Window

The windowDays parameter defines the rolling lookback period:
  • Minimum: 1 day
  • Maximum: 365 days
  • The window is always rolling — it looks back from the current moment

Limits

Each tenant can create a maximum of 20 behavioral metrics. This limit prevents excessive computation during decision time. Choose metrics that provide the most value for your decisioning rules.

Creating a Behavioral Metric

1

Navigate to Behavioral Metrics

Go to Studio > Behavioral Metrics in the sidebar.
2

Click Create Metric

Click the + New Metric button.
3

Name and key

Enter a display name and a unique key (e.g., email_freq_7d).
4

Select aggregation type

Choose from count, sum, avg, min, max, or ratio.
5

Select event type

Choose the outcome type to aggregate (impression, click, conversion, etc.). For ratio type, also select the secondary event type.
6

Set dimensions (optional)

Add up to 2 dimensions: channel, offer, or both.
7

Set time window

Enter the rolling lookback window in days (1-365).
8

Save

Save the metric. It begins computing immediately from existing interaction history.

Using Metrics in Rules

Behavioral metrics can be referenced in contact policies and qualification rules to create dynamic, data-driven decisioning.

In Contact Policies

Reference a metric in the config of a contact policy rule:
{
  "name": "Dynamic Email Cap",
  "ruleType": "frequency_cap",
  "config": {
    "metricKey": "email_impression_7d",
    "threshold": 3,
    "action": "suppress"
  }
}

In Qualification Rules

Use a metric as a soft fit multiplier:
{
  "name": "Engagement Score Gate",
  "ruleType": "propensity_threshold",
  "qualification": "soft",
  "config": {
    "metricKey": "response_rate_30d",
    "threshold": 0.1,
    "multiplierBelow": 0.3
  }
}

Recipes

Common behavioral metric patterns for real-world use cases:
Metric: Count of impressions per channel in 7 days
{
  "name": "Channel Impression Count (7d)",
  "key": "channel_impression_7d",
  "aggregationType": "count",
  "eventType": "impression",
  "dimensions": ["channel"],
  "windowDays": 7
}
Usage: Create a contact policy that suppresses offers when channel_impression_7d > 3 for any channel.

API Reference

Create a Behavioral Metric

POST /api/v1/behavioral-metrics
Content-Type: application/json
Request body:
{
  "name": "Email Impression Count (7d)",
  "key": "email_impression_7d",
  "description": "Number of email impressions in the last 7 days",
  "aggregationType": "count",
  "eventType": "impression",
  "dimensions": ["channel"],
  "windowDays": 7
}
Response (201 Created):
{
  "id": "bm_email_impression_7d",
  "name": "Email Impression Count (7d)",
  "key": "email_impression_7d",
  "description": "Number of email impressions in the last 7 days",
  "aggregationType": "count",
  "eventType": "impression",
  "dimensions": ["channel"],
  "windowDays": 7,
  "createdAt": "2026-03-10T14:30:00Z",
  "updatedAt": "2026-03-10T14:30:00Z"
}

List Behavioral Metrics

GET /api/v1/behavioral-metrics

Update a Behavioral Metric

PUT /api/v1/behavioral-metrics/:id

Delete a Behavioral Metric

DELETE /api/v1/behavioral-metrics/:id
Deleting a behavioral metric may break contact policies or qualification rules that reference it. Review dependent rules before deleting.