Real-time attributes are powerful fields on a customer's profile that update throughout the day. Instead of waiting overnight for data to process, you can view a customer's actions as they occur, aggregated in real-time.
This feature focuses on aggregating customer events (like page_visit or order_placed) to give you an immediate, up-to-the-minute understanding of customer behavior.
This article covers Realtime Attributes V2, the newest version of this feature. If you are using the V1 version, please see the Setting Up Real-Time Customer Attributes guide.
How Realtime Attributes (V2) Work
RT attributes (V2) work by "listening" for specific customer events and updating a value on their profile.
- Based on Events: Attributes are updated based on incoming events, like a customer making a purchase or visiting a specific page.
- Updates Existing Customers: This feature can only update attributes for existing customers in your database. It cannot be used to create new customers.
- Update Frequency: Aggregations run at a maximum frequency of every 1 minute, so your data is always fresh.
Calculation Types
When you create a new RT attribute, you will first choose one of two calculation types.
Lifetime
This type tracks an aggregated value over the entire history of the customer. It's perfect for tracking things like "Lifetime Total Spend" or "Total Logins".
Special Feature: Automatic Attribute Sets
A key feature of V2 is that if you choose a mathematical calculation (like Sum, Average, Count, Min, or Max), the system will automatically create a full set of related attributes for you.
For example, if you set up one attribute to calculate the Average of "purchase_amount", the system will also create:
-
purchase_amount(Minimum) -
purchase_amount(Maximum) -
purchase_amount(Count) -
purchase_amount(Sum)
This gives you a complete set of insights from a single setup. Note: This auto-generation does not apply if you select "Latest Value".
Sliding Window
This type tracks an aggregated value over a limited, recent period. This is ideal for short-term campaigns, like "How many pages has this user viewed in the last 24 hours?"
In V2, you can set the window to a fixed choice of:
- 1 day
- 2 days
- 7 days
Creating a New V2 Attribute
When you configure your new attribute, you'll fill in these fields:
Attribute Name
This is the unique name for your attribute.
- It must be 30 characters or less.
- It must start with a letter (a-z or A-Z).
Attribute Format
This is the type of data you want to store. The format you pick determines the calculations you can perform.
-
Number: For whole numbers (e.g.,
3). - Currency: For monetary values.
-
String: For text (e.g.,
promo_code_used).
Calculation Type
Choose either Lifetime or Sliding window, as described above.
Configuration Fields
After choosing your calculation type, you'll define what to calculate.
- Timeframe (Sliding Window only): Choose your window: 1, 2, or 7 days.
- Calculate: The aggregation function you want to use (e.g., Count, Sum, Latest Value).
-
Of Event: The specific customer event to track (e.g.,
order_placed). -
Return the value: The event parameter you want to aggregate (e.g.,
order_total). -
Condition (Optional): This powerful feature lets you filter which events get calculated. The attribute will only update if the event meets your condition.
- Example: You want to count purchases, but only if they used a specific discount.
- Calculate: Count
-
Of Event:
order_placed -
Condition:
coupon_code=SALE25
V2 Aggregation Functions
V2 provides six types of aggregation. The ones you can use depend on the "Attribute Format" you chose (e.g., you can't "Sum" a word).
- Latest Value: The most recent value (e.g., "Last Page Visited").
- Sum: Adds all values together (e.g., "Total Spend").
- Count: Counts the number of times an event happened (e.g., "Total Visits").
- Average (New in V2): Calculates the average value (e.g., "Average Order Value").
- Minimum Value (New in V2): Finds the smallest value (e.g., "Smallest Deposit").
- Maximum Value (New in V2): Finds the largest value (e.g., "Largest Deposit").
Aggregation Compatibility
| Attribute Format | Supported Aggregations |
|---|---|
| Number, Currency | All 6 functions (Latest Value, Sum, Count, Average, Min, Max) |
| String | Only Latest Value and Count |