Skip to content
Menu

Concepts

Computed attributes

Markdown version

Per-person values Herald computes from each person's events, such as how often they opened the app this week or when they last bought something, kept up to date as events arrive.

Some of the most useful facts about a person come from what they do, not from what your app sets: "opened the app 3 times this week", "spent $40 in the last 30 days", "last purchase 2 days ago". A computed attribute is a value Herald works out for each person from their events and stores on their profile as computed_<name>, next to the attributes your app sends.

Set them up in the console under Settings → Computed attributes (admins). Each belongs to one app.

Kinds

What to computeValueWindow
Count of an eventHow many times the event happened, as a whole numberYes
Sum of a propertyThe total of one numeric property on the event, rounded to 6 decimal places. Values that aren't numbers are ignoredYes
Last time an event happenedThe time of the latest one, as an ISO-8601 UTC string such as 2026-11-20T10:00:00.000ZNo: all history
First time an event happenedThe time of the earliest one, in the same formatNo: all history

The event is a track event name, including the SDK's own lifecycle events such as $app_opened. purchase also matches purchase events, and a sum over purchases can read price and quantity. Events your backend sends with POST /api/v1/events count the same as SDK events.

Windows

A count or sum covers a trailing window: the last N hours or days from now, by the time each event happened, up to 90 days. As events age out of the window the value goes down, and when none are left it is 0. The value stays 0 rather than disappearing, until you delete the computed attribute.

A person who has never had a matching event has no value. To find them in a segment, use "does not exist".

Which events count

Freshness

Values update on each event: when a batch, a server event or a server user import arrives for a person, their computed attributes for those events are worked out again right away, after the attributes the same request sets. Agent targeting reads the new value at once.

Windows are re-checked hourly, so a count can take up to an hour to go down after an event ages out. Segments are rebuilt hourly too, so a segment that uses a computed value can lag by up to an hour.

A new computed attribute, or one you edit, is filled in for everyone in the hour after you save it, in steps for larger apps. The list shows Filling in… N% until it is Ready. Deleting one removes computed_<name> from every person the same way.

Using values

The value is an ordinary attribute named computed_<name>; the console shows the name with a copy button.

  • Segments: an attribute condition on computed_<name>, such as greater than 2 for a count.
  • Agent targeting: a target filter key, such as computed_app_opens_7d__gte: 3.
  • The person's page: values appear with the other attributes, under Computed.
  • Message personalization: {{key}} placeholders are filled from the data sent with each message, not from the profile, so include the computed value in that data when you want it in a message.

Use as model signals

Switch on Use in personas and decisions for a computed attribute to make it a model signal: Herald adds it to each person's profile numbers, so personas and decisions reflect what people do in your app. Admins can do this on each row, or start from a template for your kind of app.

  • Limit: 6 per account, across its apps. The counter on the page reads "3 of 6 in use". At 6, the other switches can't be turned on until you turn one off; the API answers 400 with An account can use at most 6 model signals.
  • Scaling: each signal is put on a 0 to 1 scale from the values of your account's people. For last and first times, 1 means recent.
  • Readiness: the list shows Ready, Scaling, ready within the hour (the scale isn't computed yet, so the signal counts as 0 for everyone) or Needs 30 people with a value (it stays inactive until 30 people have one).
  • Editing: changing a computed attribute's definition clears its scale. It is worked out again within the hour.
  • Changing the set: turning a signal on or off, deleting one, or editing its definition makes LinUCB for the account relearn. Personas refresh at the next nightly discovery and match on the core numbers until then. Later signals move up one place when one is removed.

See App signals.

Reserved prefix

Attribute keys starting with computed_ belong to computed attributes. Your app and backend can't set them: in an SDK batch the event is rejected with invalid_field, and POST /api/v1/users answers 400.

Limits

Up to 20 computed attributes per app and 6 model signals per account, with windows of up to 90 days (2,160 hours). Names are lowercase letters, digits and _, start with a letter, are at most 40 characters, and are unique across the apps in your account. See Limits.

See Herald decide live →