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:
Computes 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.
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.
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")
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.
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.
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.
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.
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.
Click the Create dropdown and select Start with a template
In the modal, select a template and click Choose template.
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.
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.
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.
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."
[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.
[Optional] You can save the trait filter as a new trait enrichment. To do so, click the actions button and "Save trait enrichment"
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.
Click Add filter
Navigate to Custom traits and click Create a custom trait
Select a related model
Select the configuration for your trait
[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.
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.
Go to the Traits tab of the audience you want to add enrichments to.
Click Create trait.
Enter a Name and select the Parent trait.
[Optional] Add conditions to apply on top of the parent trait.
Once created, these enrichment traits appear in the Audience preview and sync configuration like any other field.
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.
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.
Give the event trait a descriptive Name.
Select the aggregation you want to use, for example, Last.
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.
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:
Select SQL as the Aggregation type.
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.
Enter a default value for when the SQL returns no rows.
Define the Property type of the SQL aggregation result.
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:
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:
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.
Select Formula as the Aggregation type.
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.
Define the Property type of the SQL aggregation result.
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.