Custom Attributes

Tag users with text, counters, and event-derived values as they move through a real-time journey.

Custom attributes let you tag each user with named values as they pass through journey nodes. In real-time journeys, attributes are available immediately to downstream nodes in the same event routing.


Supported attribute types

Real-time journeys support text, counter, Event Expression, and related-dataset custom attributes. Related-dataset attributes can look up warehouse values using a field from the incoming event or a configured warehouse relationship. A lookup adds warehouse query time but does not by itself create a batch boundary. Attribute formulas run in batch.

TypeReal-time journeysBatch journeys
Static textYesYes
CounterYesNo
Event Expression (JMESPath)Yes (on Entry nodes)No
Attribute formula (SQL)NoYes
Related dataset custom attributeYes (warehouse lookup)Yes (warehouse relationship)

For formulas and batch-only configuration, see Custom Attributes for Journeys.

Use Event Expressions to derive values from an incoming event.

Counters

Counters are integer attributes that track a value for each user while the user moves through a real-time journey. Choose one operation for each counter update:

  • Set replaces the current value with the specified amount.
  • Increment adds the specified amount to the current value.
  • Decrement subtracts the specified amount from the current value.

Counters can be referenced by downstream criteria and destination fields. They are runtime-only: GrowthLoop keeps their state in the real-time journey runtime and does not create glca_* columns or write counter values to the warehouse journey-state rows.

Annotated purchase_count custom attribute configured as a Counter with Increment and an amount of 1

Event Expressions

Use Event Expressions to turn an incoming event into named custom attributes. Filter items in an array, select the fields you want to send, or calculate a value for a downstream Criteria node.

For example, a cart event might contain devices and plans. Create one attribute to count the devices and another to return only the device SKUs and names.

Prerequisites

  • A real-time journey with a registered real-time event.
  • A sample event with the same field names and structure as your incoming messages.
  • Permission to edit the journey.

Create an Event Expression

  1. Open the Entry node's menu and select Settings.
  2. In Configure Entry Node, select the Settings tab.
  3. Click Add Custom Attribute and enter a descriptive label, such as device_count.
  4. Choose Event Expression from the attribute type menu.
Annotated Entry settings showing Add Custom Attribute and the Event Expression type
  1. Choose a Result type that matches the value your expression returns.
Result typeUse it forAvailable in criteria
StringA text value, such as a product categoryYes
NumberA count, amount, or calculated numeric valueYes
BooleanA true or false conditionYes
JSON (object or array)A filtered array or selected object fields for a destinationNo
  1. Enter a JMESPath expression in the Editor. The expression reads the incoming event. Field names and comparisons are case sensitive.
  2. Use View event schema to check the source event's fields. Optionally, describe the value you want in AI Studio and click Generate expression, then review the generated expression.

Example: count matching items

This example uses the following synthetic event. Replace the field names and values to match your own event.

{
  "cart_content": [
    {"category": "DEVICE", "sku": "PHONE-001", "name": "Example phone"},
    {"category": "PLAN", "sku": "PLAN-001", "name": "Example plan"},
    {"category": "DEVICE", "sku": "CASE-001", "name": "Example case"}
  ]
}

Set the attribute label to device_count and Result type to Number, then enter:

length((cart_content || `[]`)[?category == 'DEVICE'])

The filter keeps only items whose category is DEVICE. The length(...) function counts those items, returning 2 for the sample event. If cart_content is missing or empty, the expression returns 0.

Annotated device_count attribute with Number selected and a JMESPath expression that counts DEVICE items

Example: select fields for a destination

Create a second attribute labeled device_items, choose JSON (object or array), and enter:

(cart_content || `[]`)[?category == 'DEVICE'].{sku: sku, name: name}

This expression filters the same array and returns only sku and name for each matching item:

[
  {"sku": "PHONE-001", "name": "Example phone"},
  {"sku": "CASE-001", "name": "Example case"}
]

If cart_content is missing or empty, the result is []. A missing projected field, such as name, becomes null.

Annotated device_items attribute with JSON selected and an expression that keeps DEVICE item SKUs and names

Check and save your expression

  1. Open the Preview tab beside Editor.
  2. Paste a synthetic event into Sample JSON event.
  3. Click Run preview below the sample editor and inspect Output. Rerun the preview whenever you change the expression, result type, or sample.
  4. Check a matching event, an event with no matching items, and an event with missing optional fields. Confirm that the result matches the selected type.
  5. Click Apply in the Entry configuration, then Save the journey. Publish the journey when you are ready to use the expression with incoming events.

The sample preview is browser-only. Sample JSON is temporary and is not saved or sent to AI. Previewing an expression does not submit an event to your journey.

Use the results downstream

  • Criteria: Select a String, Number, or Boolean custom attribute. For example, use device_count greater than 0 to select events containing at least one device. JSON attributes do not appear in criteria fields.
  • Destinations: Select the custom attribute in your field mappings. For example, map device_items to a destination field that accepts an array of objects. Check your destination's template or API requirements before sending structured values.

Expressions read the event at the real-time Entry node. Downstream nodes use the resulting custom attributes; warehouse processing carries those values without evaluating the expression again.

After an attribute has been published, use a new label if you need to change its result type. JSON result storage is unavailable on Redshift; use String, Number, or Boolean there.

Troubleshooting

These are the issues we see most often. You can always email us at [email protected] for help.

ProblemCauseResolution
An attribute is missing from criteria fieldsThe result type is JSON, or the journey has not been savedChoose String, Number, or Boolean for criteria, then apply the Entry settings and save the journey. Use a separate numeric expression to count items in a JSON array.
The result is empty or nullThe event field is missing, the path is incorrect, or no array item matchesCheck View event schema and your sample. Match field names and letter case exactly. Default optional arrays to an empty array, as shown in the examples above.
The result does not match the selected typeThe expression returns a different kind of valueAdjust the expression or select the correct result type. Use a new label when changing a published attribute's type.
Preview reports that it is unavailableThe current environment does not support the previewContact [email protected] to confirm preview availability. Do not treat an unavailable preview as a successful test.
Publishing a JSON attribute fails on RedshiftJSON result storage is unsupported on RedshiftUse a scalar result type or a supported warehouse for JSON values.

Event-keyed warehouse lookups

Use Related Dataset Fields to retrieve a warehouse value by matching a field in the incoming event to a column in a dataset. For example, match an event's Email Address to the customer's Email Address, then return First Name as customer_first_name. You can also match a product ID in an event to a product dataset and return its name or category.

With Incoming event selected as the join source, the dataset must belong to your journey's Dataset Group, but it does not need a configured relationship to the primary dataset. GrowthLoop uses the current event's key for the lookup, so two events from the same customer can retrieve different products or orders.

This differs from an Event Expression: an expression derives a value from the event itself; a lookup retrieves a value from your warehouse.

Before you start

  • Register the event and include the lookup key in its schema. The Event field picker supports string and integer fields, including supported nested fields; objects and arrays cannot be selected as lookup keys.
  • Add the reference dataset to the journey's Dataset Group and confirm that your Source can read it.
  • Choose a node on the real-time path, identified by its lightning bolt. Incoming event lookups are unavailable after a batch boundary.

Configure the lookup

  1. Open the Entry node's menu, select Settings, and open the Settings tab in Configure Entry Node.
  2. Click Add Custom Attribute, enter a label such as customer_first_name, and select Related Dataset Fields as the attribute type.
  3. Set Join source to Incoming event.
  4. Select the Dataset to search, such as your customer dataset. The Event field, Match table column, and Field pickers appear after you select a dataset.
  5. Select Event field, then Match table column. These are the values GrowthLoop matches: for example, the event's Email Address and the dataset's Email Address. Use fields with compatible types and matching formats.
  6. Select Field, the value to return from the matched rows. For this example, select First Name.
Annotated Entry settings showing Incoming event as the join source, email fields matched between event and dataset, and First Name selected as the returned value
  1. Choose Type to resolve matching rows. Use Arbitrary when any matching row is acceptable, Order By to choose a row by a defined sort, or an aggregation to combine matching values. Add filters if you need to narrow the eligible rows. See Related Custom Attributes for resolution options.
  2. Click Apply, then Save the journey. Publish when you are ready to use the lookup for incoming events.

The returned value is available under your custom attribute's label to downstream criteria, destination mappings, and Trigger templates. Attributes added to a Criteria node are applied after that node evaluates its conditions; define an attribute upstream if you need it in the criterion itself.

Check the result

Use test events with known matching keys and confirm that a downstream node receives the expected custom attribute. Include two events with different keys, even if they belong to the same customer, and check that each receives its own matching value.

If a lookup returns no result, GrowthLoop sets the attribute to null and continues. Check for empty values before using the result in a required destination field. If multiple rows match, the selected Type determines the result; Arbitrary does not guarantee which row is chosen.

If Incoming event is missing, confirm that the journey has a registered real-time event and that the node is still on the real-time path. If a key is missing from Event field, check its registered schema and type.


Where to set custom attributes

Add custom attributes in the Settings tab on:

  • Entry node
  • Criteria node (separate values depending on which sub-criteria matches)
  • Destination node
  • Experiment variation node (separate values depending on which variation the message is assigned to)
  • Trigger node (via response fields)
Annotated node Settings tab with a custom attribute labeled status, the Text type, and the value VIP

Waterfall behavior

Custom attribute values set at one node are available at all downstream nodes in the same message path — the same waterfall behavior as batch journeys. A criteria node can filter on attributes set by an upstream node, and downstream destinations and trigger templates can reference these labels. Attributes set on the current criteria node are applied after that node evaluates its conditions.


Using attributes downstream

Custom attributes can be selected in destination nodes as match fields or additional fields. Map them to template fields for email, SMS, or in-app destinations. Text and counter values are inserted into the template before the event is triggered in real time.

Related-dataset custom attributes can be resolved through real-time warehouse enrichment. Choose Incoming event to match an event field to a dataset column, or Warehouse relationship to use the dataset's configured relationship to the primary dataset. Warehouse queries add lookup time; they do not by themselves turn a real-time node into a batch node.


Related guides


Did this page help you?