ChangelogBook a demoSign up

Traits

AudienceMarketers and analytics/data engineers
Prerequisites
  • A defined schema with at least one parent model.
  • (Optional) Connected destinations for syncing audiences.

Overview

When defining audiences, you sometimes need computed or calculated attributes rather than raw data. For example, you may want to create an audience based on Lifetime Value (LTV) though you don't have this column in your Users table. Creating it entails summing the price of all purchases made by a particular user.

Hightouch Traits enable users of any technical background to:

  • Create computed fields
  • Use them to define audiences
  • Sync them to business applications

You can use these computed fields—called traits—to supercharge personalization across marketing channels without having to rely on data teams.

Traits page

Trait types

Trait TypeDescriptionExample Usage
AggregationCalculates the sum or average of a numeric field across a related or event model.Total amount a user has spent across all purchases (order_value)
CountCounts the number of records that match optional filters.Number of emails a user opened in the past 30 days
OccurrenceReturns the first, last, most frequent, or least frequent value from a column in related data.Most frequently viewed product category or last brand interacted with
ListReturns an array of values from related or event records, with optional sorting, slicing, and filters.List of SKUs a user has browsed or added to cart in the past 7 days
SQL AggregationUses SQL to calculate a value across related records. Supports advanced logic like JSON or arrays.JSON object of purchased products with price and quantity, for use in dynamic email personalization
SQL FormulaComputes logic using SQL on parent model fields without joins. Ideal for string manipulation or flags.Boolean trait for whether a user is in a loyalty program (membership_tier = 'Gold')

Traits are defined on a parent model, but you can also create traits based on events to capture information about customer actions in a customer funnel.

Create a trait

You can create a trait in one of three ways: Option 1:

  1. Go to Customer Studio → Traits
  2. Click the Create dropdown and select New trait
    Creating traits in the Hightouch UI
    Option 2: Select Start with a template to use a predefined calculation Option 3: Create a custom trait while building an audience using the Custom traits filter group.

Configure traits

Step 1: Method

In the New trait flow, the first step is choosing the logic type.

  1. Select a parent model.
  2. Select the calculation method.

Available calculation methods:

  • Aggregation: Sum or average across rows
  • Count: Total number of matching events
  • Occurrence: First, last, most frequent, or least frequent value
  • List: Return an array of values
  • SQL Aggregation: SQL for grouping/array logic
  • SQL Formula: SQL expressions based on parent properties

Step 2: Calculation

In Step 2, you'll configure the logic for your selected calculation method. The fields shown depend on the method you chose in Step 1 (e.g., Aggregation, Count, Occurrence, SQL, etc.).

For most methods, you’ll need to:

  • Select a related or event model Choose the dataset you're calculating across (e.g., Purchases, Sessions, Page Views)
  • Add optional filters Filter the input records before applying your calculation (e.g., REVENUE > 500, event_type = "checkout")
  • Complete method-specific settings
Filters can include field-based logic (e.g., REVENUE > 500) and will be applied before aggregation.

Configure trait method in the Hightouch UI

Use the Preview results button to validate before moving to the final step.

Method specific settings

Aggregation traits (Sum, Average)

Use case: Compute the sum or average of a numeric column across related or event data.

You’ll configure:

  • Related or event model (e.g. Purchases)
  • Filter conditions (optional)
  • Aggregation type: Sum or Average
  • Column to aggregate (e.g. REVENUE)

Count traits

Use case: Count the number of records (e.g. purchases, sessions, clicks) that meet a condition.

You’ll configure:

  • Related or event model
  • Optional filters
  • Count by: Select a column (optional — defaults to row count)

Occurrence traits (First, Last, Most frequent)

Use case: Return the first, last, or most frequent value of a column from a related model.

You’ll configure:

  • Related or event model
  • Optional filters
  • Occurrence type: First / Min, Last / Max, Most frequent, or Least frequent
  • Trait value: Column to return (e.g. product_name)
  • Order by: Determines ordering for first/last

List traits

Use case: Return an array of values for use in downstream tools (e.g. product IDs, brand names).

You can configure:

  • Column to list (e.g. product_id)
  • Optional filters
  • Deduplication toggle: Check to skip duplicate values
  • Order by and Sort direction
  • Optional slice controls: Optionally, choose which part of the list to return (e.g. first 3)

SQL Aggregation traits

Use case: Build advanced calculations using SQL across related models.

You’ll configure:

  • SQL expression, using {{ column "<name>" }} syntax
  • Default value for null or missing results
  • Property type (e.g. String, Number, Boolean)

SQL Formula traits

Use case: Compute logic based on fields from the parent model using SQL. Does not join to related models.

You’ll configure:

  • Formula expression (no {{ }} syntax—just reference columns directly)
  • Property type

Note: In SQL Formula traits, use direct field names (e.g. ltv, email_verified) instead of {{ column }} syntax.

Step 3: Finalize

  1. Give your trait a clear name and optional description. This name will appear when filtering in the audience builder.

The summary shows your configured logic in plain language for easy review.

Finalize trait in the Hightouch UI

  1. Click Create trait to finish.

The trait is now part of the parent model, and you can use it when creating audiences. It will automatically be available to sync for any audience that belongs to this parent model.

View and manage traits

After creation, traits appear in the Traits table, where you can:

  • View name, parent model, calculation type, and related model
  • Edit or archive traits

Traits main page

Use the tabs to switch between:

  • Traits: All saved traits
  • Templates: Reusable logic blueprints
  • Archived: Any traits you've deactivated

Traits templates page
Traits archive page

Trait configuration and usage

Click into any trait to view:

  • The Configuration tab: shows logic summary and allows edits
  • The Usage tab: lists audiences where this trait is used

Traits configuration tab
Traits usage tab

Trait templates

Trait templates let you define reusable logic that can be used as a base for other traits. You can create templates once and generate new traits from them, saving time and ensuring consistency across teams.

Create a new template

To create a template:

  1. Go to Customer Studio → Traits
  2. Click the Create dropdown and select New template

Create new template

The flow for creating a template is the same as creating a standard trait:

  • Choose a parent model
  • Select a calculation method
  • Configure filters and logic
  • Finalize the template by naming and saving it

Once saved, the template appears under the Templates tab.

Traits template tab

Updating a trait template will also update all traits created from it—unless those traits have overridden the base logic. For example, if you change a template’s aggregation type from Sum to Count, any traits built directly from that template will adopt the new Count method automatically.

Create a trait from a template

Once you’ve created a template, you can use it to quickly generate new traits with consistent logic.

To create a trait from a template:

  1. Go to Customer Studio → Traits
  2. Click the Create dropdown and select Start with a template
  3. In the modal, select a template and click Choose template.

Start with a trait template

  1. In the Choose a template modal, select your desired template from the list.

    • You’ll see a summary of the calculation logic, including parent and related models.
    • Click Preview results to validate the output.
    • Click Choose this template to continue.

Choose a template modal

  1. On the next screen, you'll see the template logic pre-populated.

    • (Optional) Add additional filter conditions.
    • Enter a Name and optional Description.
    • Click Preview results to validate trait output.
    • Click Save to finalize.

Save trait template

Once saved, this trait will be available in the Traits tab and can be used for audience filters and destination syncs.

Changes made to the base template will automatically update all traits created from it—unless local filters or logic were modified when the trait was saved.

Create audiences with traits

Once you've created a trait, you can use it for filtering within your audiences. Traits filters are under Custom traits in the filters dropdown.

Trait filter option

There are three kinds of traits you can use in your audience filter:

  • Trait templates
  • Traits
  • Custom traits

Use trait templates in the audience

  1. Click Add filter
  2. Navigate to Custom traits and select a trait template. For example, if you created an LTV trait, you can use it to filter for "All users that have spent more than $100."

Using a trait to filter audiences

  1. [Optional] You can also add filters to apply before Hightouch calculates trait values. For example, you can restrict the LTV calculation to purchases where the Brand was Nike directly in the audience builder.

Filtering traits in the Hightouch UI

  1. [Optional] You can save the trait filter as a new trait enrichment. To do so, click the actions button and "Save trait enrichment"

Use traits in the audience

  1. Click Add filter
  2. Navigate to Custom traits and select a trait

Trait to filter audiences

  1. [Optional] You can edit the trait configuration by clicking Edit. Updating these filters will not affect the original trait.
  2. [Optional] If you edit the trait and want to save it as a new trait, click the actions button and "Save trait."

Save edited trait

Create a custom trait within the audience

Maybe you don't have a suitable trait or trait template to act as a filter. Or, maybe you just want to experiment with a trait filter without necessarily creating one for the parent model. You can create a custom trait inline within the audience query builder.

  1. Click Add filter
  2. Navigate to Custom traits and click Create a custom trait
  3. Select a related model
  4. Select the configuration for your trait

Custom trait calculation to filter audiences

  1. [Optional] If you decide that this custom trait is useful enough to persist it for the entire parent model, click the actions button and "Save trait." Doing so converts it into a new trait that can be synced.

Save custom trait calculation

Enrich audiences with traits

Traits defined on the parent model are automatically available for syncing to destinations. Alternatively, you can create trait enrichments which are traits that are specific to an audience.

Trait enrichments are based on a parent trait which are the trait templates you've defined on the parent model.

Adding a trait enrichment

  1. Go to the Traits tab of the audience you want to add enrichments to.
  2. Click Create trait.
  3. Enter a Name and select the Parent trait.
  4. [Optional] Add conditions to apply on top of the parent trait.

Defining a trait enrichment

Once created, these enrichment traits appear in the Audience preview and sync configuration like any other field.

Event traits

In addition to defining traits on parent models, you can also apply traits to events in the visual audience builder. Event traits automatically become trait enrichments, meaning you can view them in the preview and sync their values. One common use case for event traits is to capture information about abandoned carts.

  1. To create a new event trait, click Add trait on an event condition in the audience builder.

You can only access the Add trait option from an event filter once you've saved the audience.

Adding an event trait in the Hightouch UI

  1. Give the event trait a descriptive Name.
  2. Select the aggregation you want to use, for example, Last.
  3. Select the information you want to capture about the event. For example, you may want to capture the Product_ID, SKU, or Brand of the final product a user added to their cart before abandoning it.

Defining an event trait in the Hightouch UI

Custom SQL traits

Custom SQL traits provide a powerful escape hatch for custom aggregations that the default aggregations don't cover. To build a SQL trait, create a trait and follow these additional instructions:

  1. Select SQL as the Aggregation type.
  2. Enter a raw SQL aggregation. For example, to create a SUM trait with just SQL, you would enter SUM({{ column "price" }}).
Column references must use the following syntax {{column "<COLUMN_NAME>"}}. Column names are case-sensitive.
  1. Enter a default value for when the SQL returns no rows.
  2. Define the Property type of the SQL aggregation result.

JSON aggregations

JSON aggregations are a helpful way to aggregate the raw data in a related model. For example, imagine you want to get a list of all product IDs users have purchased. You can do this with the following SQL trait:

ARRAY_AGG(DISTINCT {{column "product_id"}})

CASE statements

CASE statements are a useful way to create friendly options for aggregations. For example, imagine you want to bucket customers into low, medium, and high LTV. You can do this with the following SQL trait:

CASE
  WHEN SUM( {{column "price"}} ) > 100 THEN 'high'
  WHEN SUM( {{column "price"}} ) > 50 THEN 'medium'
  ELSE 'low'
END

Formula traits

Formula traits allow you to reference parent model columns, merged columns, and other traits to build inline transformations. Unlike Custom SQL Traits, there is no aggregation against a single related model. Instead, you can reference columns from a multitude of sources. This unlocks a powerful and flexible way to compose columns all within Hightouch.

Formula trait editor

  1. Select Formula as the Aggregation type.
  2. Enter raw SQL. To reference a column or trait, type the name for the autocompletion dropdown to show up. Then, select it to populate the editor as shown above. Here are a few examples of SQL queries that can be done using formula traits:
  • Combine multiple columns into one: CONCAT({{"first_name"}}, ' ', {{"last_name"}}).
  • Use a string column to create a boolean flag: CASE WHEN {{"merged.pets.animal"}} LIKE 'dog' THEN true ELSE false END
  • Reference other traits: CASE WHEN {{"trait.lifetime_total_value"}} > 1000 THEN 'high' ELSE 'low' END.

Column references in formula traits use special syntax. Please use the SQL editor's autocompletion feature to write the column references.

References to non-existent columns or traits will be shown with a red pill.

Broken formula trait column

  1. Define the Property type of the SQL aggregation result.

Trait value suggestions

Most Frequent, First, Last, Custom SQL, and Formula traits that result in a string type support trait value suggestions. When enabled this provides suggested values for the visual audience builder. For example, if you're creating an audience you want to filter on a "Most Recent City" trait, turning on suggestions populates a dropdown with values—San Francisco, Los Angeles, etc.—found in the dataset.

Enabling suggestions

Trait value suggestions can be enabled when creating or viewing a trait.

Enabling trait value suggestions

Ready to get started?

Jump right in or a book a demo. Your first destination is always free.

Book a demoSign upBook a demo

Need help?

Our team is relentlessly focused on your success. Don't hesitate to reach out!

Feature requests?

We'd love to hear your suggestions for integrations and other features.

Privacy PolicyTerms of Service

Last updated: Jul 30, 2025

On this page

Was this page helpful?