Skip to contentSkip to navigationSkip to topbar
Page toolsOn this page
Looking for more inspiration?Visit the

Engage and Warehouses


FREE x
TEAM x
BUSINESS
ADDON

Engage provides a complete, up-to-date view of your customers through Audiences and Journeys, and one of the best ways to analyze this data is in your data warehouse using SQL.

With Engage, you can send Computed Traits and Audiences to a data warehouse like Redshift, BigQuery, or Snowflake. This allows you to perform analysis and reporting around key customer audiences and campaigns, as well set up your user data as input into predictive models.

Segment offers two ways to integrate Engage with your data warehouse:

  1. Storage Actions Destinations (recommended): Write Linked Audiences and Event-Triggered Journeys data to your warehouse
  2. Classic Storage Destinations: Send Computed Traits and Profile Audiences to your warehouse

Which should you use?

which-should-you-use page anchor
  • Use Storage Actions Destinations to write Linked Audiences and Event-Triggered Journeys data to Snowflake, Databricks, Redshift, and BigQuery warehouses.
  • Use Classic Storage Destinations for Computed Traits and warehouses not supported by Storage Actions Destinations.

Set up a warehouse actions instance

set-up-a-warehouse-actions-instance page anchor

Before setting up a warehouse actions instance, set up Linked Audiences.

Connect to Engage

connect-to-engage page anchor

You must connect your warehouse destination to the Engage space to set up warehouse actions.

Add the warehouse destination instance to the Engage space

add-the-warehouse-destination-instance-to-the-engage-space page anchor

To add the warehouse destination instance to the Engage space:

  1. Go to the Engage Destination settings.
  2. Select Add another destination from the catalog.
  3. Select the warehouse destination in the Storage connection type.
  4. (Optional) Choose your Engage space as the Data Source.
  5. Select either Use existing warehouse or Set up new warehouse.

If you select Use existing warehouse: Select the warehouse instance you want to write data to from the connected destination list. Once selected, your warehouse instance is now connected to the Engage space.

If you select Set up new warehouse:

  1. Follow the warehouse destination setup steps:
  1. Select Test connection.
  2. Select Set up activation.

Once you've connected your warehouse to the Engage space, you can use this in Engage Settings > Destinations list.

Add the activation with the destination

add-the-activation-with-the-destination page anchor
  1. Select the warehouse destination instance you want to write data to from the connected destination.
  2. Define the table name, event properties and field mappings.

Segment scopes the write calls to <Engage_Space_Name>.<User_Specified_Table_Name>. Segment restricts write calls to the same schema, and does not support writing to the schema.

Segment stores entity context objects in a single Stringified JSON column to avoid hitting the warehouse's column limits.


Classic Storage Destinations

classic-storage-destinations page anchor

Classic Storage Destinations let you send Computed Traits and Profile Audiences to your warehouse as identify or track calls. This integration follows the standard Segment warehouse ETL process with scheduled syncs.

Use Classic Storage Destinations for:

  • Computed Traits (event-based, SQL-based, or machine learning traits)
  • Profile Audiences using Identify or Track calls
  • Warehouses that don't support Storage Actions Destinations

When you build an audience or computed trait, you can configure it to send an identify call or a track call to your data warehouse, and additionally include mobile ids.

Redshift connection settings with options for sending identify and track data.

Set up a warehouse actions instance

set-up-a-warehouse-actions-instance-1 page anchor

Pre-requisite: Set up Linked Audiences.

(information)

Connect to Engage

You must connect your warehouse destination to the Engage space to add activation.

Add the warehouse destination instance to the Engage space

add-the-warehouse-destination-instance-to-the-engage-space-1 page anchor

To add the warehouse destination instance to the Engage space:

  1. Go to the Engage Destination settings.
  2. Select Add another destination from the catalog.
  3. Select the warehouse destination in the Storage Connection type.
  4. (Optional) Choose the Engage space as the Data Source.
  5. Select from either Use existing warehouse or Set up new warehouse.
    • If you select Use existing warehouse:
      • For an existing warehouse, select the warehouse instance.
      • Your warehouse instance is now connected to the Engage space.
      • Verify in the Engage Settings, the destination list.
  • If you select Set up new warehouse:
    • Reuse existing credentials or input your credentials (username and key-pair authentication).
    • Test the connection.
    • Select Set up activation.

Your warehouse instance is now connected to the Engage space. You can verify this in Engage Settings > Destinations list.

Add the activation with the destination

add-the-activation-with-the-destination-1 page anchor
  1. Select the warehouse destination instance you want to write data to from the connected destination.
  2. Specify the table name, event properties, and mapping to define the structure.
    • You can write data from multiple audiences and activations to a single table by specifying table names. Write calls are restricted to the same schema. X-schema writes are not supported.
      • Segment writes data to <Engage_Space_Name>.<User_Specified_Table_Name>
    • Mapping allows you to elevate specific entity context fields into columns.
      • Segment stores entity context objects in a single Stringified Json column to avoid hitting the Snowflake's column limits.
    • By default, syncs run on an hourly basis. You can configure sync frequency for the warehouse by accessing the warehouse settings. Note: Sync frequency change will impact other write calls to the warehouse – for example, Profiles Sync, Connections.

Identify calls for audiences

identify-calls-for-audiences page anchor

If you chose to send your Engage data as an identify call, Engage usually sends one call per user.

When you send audiences as an identify call, Engage includes a boolean trait that matches the audience name. When a user enters an audience the boolean is set to true, and when they exit, the boolean is set to false.

In the example below, you can see that the identify payload includes a trait of the audience first_time_shopper with the value of true.

1
{
2
"type": "identify",
3
"userId": u123,
4
"traits": {
5
"first_time_shopper": true // false when a user exits the audience
6
}
7
}

Identify calls for computed traits

identify-calls-for-computed-traits page anchor

When you send computed traits as an identify call, Engage sends a similar call with the computed value for that trait. In the example below, the trait total_revenue_180_days includes the calculated value of 450.00.

1
{
2
"type": "identify",
3
"userId": u123,
4
"traits": {
5
"total_revenue_180_days": 450.00
6
}
7
}

Warehouse schema for Engage identify calls

warehouse-schema-for-engage-identify-calls page anchor

Engage identify calls appear in your warehouse using a similar format as normal Connections identify calls. Identify calls appear in two tables per Engage space. These tables are named with a prefix of engage_, then the Engage space name, followed by identifies or users. The identifies table contains a record of every identify call, and the users table contains one record per user_id with the most recent value.

The engage_ schema name is specific to the Engage space and cannot be modified. Additional audiences and computed traits appear as additional columns in these tables.

engage_default.identifies

user_idfirst_time_shoppertotal_revenue_180_days
u123true
u123450.0

engage_default.users

user_idfirst_time_shoppertotal_revenue_180_days
u123true450.00

Track calls for audiences

track-calls-for-audiences page anchor

When you send audiences using track calls, Engage sends an Audience Entered event when a user enters, and an Audience Exited event when the user exits, by default. These event names are configurable.

Engage also sends two event properties about the audience: the audience_key, which records the name of the audience that the event modifies, and the audience name and its value, as a separate key and value pair. The value of the audience key is populated with a boolean value.

In the example below, you can see that the audience_key is set to record a modification to the first_time_shopper audience, and the first_time_shopper value is set to true.

1
{
2
"type": "track",
3
"userId": u123,
4
"event": "Audience Entered",
5
"traits": {
6
"audience_key": "first_time_shopper",
7
"first_time_shopper": true
8
}
9
}

Track calls for computed traits

track-calls-for-computed-traits page anchor

When you send computed traits, Engage sends a Trait Computed event that records which computed trait it updates, then records the updated key and value. You can also customize this event name.

Configuring connection settings to send computed traits.

In the example below, the Trait Computed event contains the trait_key which records which computed trait is being modified, and then includes the key total_revenue_180_days with the updated value of 450.00.

1
{
2
"type": "track",
3
"userId": u123,
4
"event": "Trait Computed",
5
"traits": {
6
"trait_key": "total_revenue_180_days",
7
"total_revenue_180_days": 450.00
8
}
9
}

Warehouse schema for Engage track calls

warehouse-schema-for-engage-track-calls page anchor

Similar to track calls in Connections, Engage track calls appear in your warehouse as one table per event name. For example, if you configure your events called Audience Entered, Audience Exited, and Trait Computed, Engage would create tables like the following examples in your warehouse:

engage_default.audience_entered

user_idaudience_keyfirst_time_shopper
u123first_time_shoppertrue

engage_default.audience_exited

user_idaudience_keyfirst_time_shopper
u123first_time_shopperfalse

engage_default.trait_computed

user_idtotal_revenue_180_daystrait_key
u123450.00total_revenue_180_days

The users table is an aggregate view based on the user_id field. This means that anonymous profiles with just an anonymous_id identifier aren't included in this view. You can still view identify calls for anonymous audiences and computed traits in the identifies table.

The users table is synced as soon as the warehouse is connected as a destination in Engage, if you've previously created Engage computations. As a result, the table might contain data from computations not directly connected to the warehouse.


Although Engage can compute audiences and traits in real-time, these calculations are subject to the sync schedule allowed by your warehouses plan, which is usually hourly. You can check the warehouse sync history to see details about past and upcoming syncs. When you look at the sync schedule, sources with the engage_ prefix sync data from Engage.


Which warehouse destination should I use?

which-warehouse-destination-should-i-use page anchor

Use Storage Actions Destinations for Linked Audiences, Event-Triggered Journeys, and Profile Audiences with Snowflake, Databricks, Redshift, or BigQuery. Use Classic Storage Destinations for Computed Traits or warehouses not supported by Storage Actions Destinations.

Can I use both Storage Actions and Classic Storage at the same time?

can-i-use-both-storage-actions-and-classic-storage-at-the-same-time page anchor

Yes, you can use both concurrently. For example, send Computed Traits with Classic Storage and Linked Audiences with Storage Actions.

What's the main difference between Storage Actions and Classic Storage?

whats-the-main-difference-between-storage-actions-and-classic-storage page anchor

Storage Actions syncs data after each audience or journey run completes, while Classic Storage uses scheduled hourly syncs. Storage Actions also gives you more control over schema and table naming.

How quickly does data appear in my warehouse with Storage Actions?

how-quickly-does-data-appear-in-my-warehouse-with-storage-actions page anchor

Segment starts a warehouse sync after each audience or journey run completes. Data typically appears within minutes, depending on warehouse performance.

Can I customize the schema and table names for Storage Actions?

can-i-customize-the-schema-and-table-names-for-storage-actions page anchor

Yes, when you create an activation, you can choose the schema and define the table name. Data write calls are scoped to <Engage_Space_Name>.<User_Specified_Table_Name>.

Can I send Computed Traits using Storage Actions?

can-i-send-computed-traits-using-storage-actions page anchor

No, Computed Traits currently only work with Classic Storage Destinations.

Can I prevent a table, a computed trait, or audience from syncing to my warehouse?

can-i-prevent-a-table-a-computed-trait-or-audience-from-syncing-to-my-warehouse page anchor

Yes. You can use Warehouses Selective Sync to manage which traits, audiences, and tables get synced from Engage.

Why are there multiple schemas prefixed with engage_ in my warehouse when I only have one space?

why-are-there-multiple-schemas-prefixed-with-engage_-in-my-warehouse-when-i-only-have-one-space page anchor

Segment can only connect a source to one instance of each destination. For example, one source cannot send to two different Amplitude instances. As a workaround, Engage creates multiple sources to send events to the destinations connected to your space.

For example, if you have three webhook destinations in your space, Engage creates three different sources to send events to them. This creates three different warehouse schemas, and is usually the reason you have more schemas than spaces.

This approach doesn't apply to messaging destinations, however. Messaging destinations connected from journeys and broadcasts don't generate multiple background sources.