Skip to content
Last updated

Braze Currents Import Integration

The Braze platform provides insight into new growth opportunities and brand interactions that can help you build transformative campaigns and take strategic actions. With Braze Currents you can push data to Treasure Data and make it actionable across the entire growth stack.

The Braze Streaming Ingress Connector is a native input connector that enables real-time data streaming from Braze to Treasure Data. This connector enhances customer trust and resolves limitations of the previous Postback API integration method.

Prerequisites

  • Active Braze account with appropriate permissions
  • Enable (Beta) Braze Currents Streaming connector on your TD account (Request to Treasure Data Support team)
  • TD API Write Key to write events to your table

Configuration

In Treasure Data Console

  1. Navigate to Connections > New Connection
  2. Select “Braze Currents Streaming” from the list of connectors
  3. Configure the following Authentication settings:
    • Authentication:
      • TD Write Key (required)
  4. Configure the following Source settings:
    • Connection
      • Source Name
    • Data Settings
      • Datastore: Plazma
      • Tags (optional): Tags can be used to find this source.
      • Database (required): Database where you want to import
      • Table (required): Table where you want to import
      • Multiple Tables option (checkbox):
        • If enabled, events go to different table based on your configuration on Currents (link)
  5. Copy Unique ID as task_id for Braze Configuration from Source

In Braze Platform

  1. Go to Partner Integration → Data Export
  2. Create a new Custom Current (select Treasure Data will use the legacy integration)
  3. Enter the Treasure Data endpoint URL provided during TD setup
    • US Region: https://braze-in-streaming.treasuredata.com/v1/task/{task_id}
    • EU01 Region: https://braze-in-streaming.eu01.treasuredata.com/v1/task/{task_id}
    • AP02 Region: https://braze-in-streaming.ap02.treasuredata.com/v1/task/{task_id}
    • Tokyo Region: https://braze-in-streaming.treasuredata.co.jp/task/v1/{task_id}
  4. Enter "YOUR_WRITE_APIKEY" as Bearer Token​
  5. Select the event types to export

Data Ingestion

The connector automatically flattens the JSON data up to two nested levels. Events are stored in the specified table(s) based on your configuration.

Data Type Mapping

JSON Data TypeSchema Data Type
stringstring
numberlong
booleanstring
arrayJSON
objectFlattened (up to level 2)
nullIgnored

Column Naming Convention

  • Lowercase letters and underscores only
  • Level 1 fields: field_name
  • Level 2 fields: parent_field_name_field_name

Querying Data

To query the ingested data, use SQL queries. Example:

SELECT 
  id AS event_id,
  event_type,
  time AS event_time,
  user_user_id,
  user_external_user_id,
  properties_dispatch_id,
  properties_campaign_id,
  properties_message_variation_id,
  properties_email_address,
  properties_user_agent,
  properties_campaign_name,
  properties_message_variation_name
FROM
  your_database.your_table
WHERE
  TD_INTERVAL(
    time,
    '-1d',
    'JST'
  )

Limitations and Considerations

  • Maximum payload size: 1 MB
  • Events are grouped into batches of 100 by default

Legacy Integration documentation

What can you do with this Integration?

The recommended approach is to move data from Braze Currents to Treasure Data is using the Postback API. This method doesn’t require an out-of-the-box connector. Rather, Treasure receives data through the Treasure Data Postback RESTful API. All events sent in one data batch are inside of one field of one row in a JSON array, which needs to be parsed to get the required data.

Prerequisites

Integration

Instructions for creating a Braze Current integration can be found on the Braze website at Treasure Data for Currents. Braze will directly send the updated events to Treasure Data in real-time, with the exception of data ingestion which can take several minutes using the event-collector.

After Braze Currents has pushed the data to Treasure Data, you can extract the data from the TD Console using a query similar to this:

Note

Ensure that you verify a query's output results as valid before using it in production environment.

SELECT  json_extract_scalar(event, '$.id') AS event_id,  json_extract_scalar(event, '$.event_type') AS event_type,  json_extract_scalar(event, '$.time') AS event_time,  json_extract_scalar(json_extract(event, '$.user'), '$.user_id') AS user_id,  json_extract_scalar(json_extract(event, '$.user'), '$.external_user_id') AS external_user_id,  json_extract_scalar(json_extract(event, '$.properties'), '$.dispatch_id') AS dispatch_id,  json_extract_scalar(json_extract(event, '$.properties'), '$.campaign_id') AS campaign_id,  json_extract_scalar(json_extract(event, '$.properties'), '$.message_variation_id') AS message_variation_id,  json_extract_scalar(json_extract(event, '$.properties'), '$.email_address') AS email_address,  json_extract_scalar(json_extract(event, '$.properties'), '$.user_agent') AS user_agent,  json_extract_scalar(json_extract(event, '$.properties'), '$.device_class') AS device_class,  json_extract_scalar(json_extract(event, '$.properties'), '$.device_os') AS device_os,  json_extract_scalar(json_extract(event, '$.properties'), '$.browser') AS browser,  json_extract_scalar(json_extract(event, '$.properties'), '$.ip_pool') AS ip_pool,  json_extract_scalar(json_extract(event, '$.properties'), '$.machine_open') AS machine_open,  json_extract_scalar(json_extract(event, '$.properties'), '$.esp') AS esp,  json_extract_scalar(json_extract(event, '$.properties'), '$.from_domain') AS from_domain,  json_extract_scalar(json_extract(event, '$.properties'), '$.is_amp') AS is_amp,  json_extract_scalar(json_extract(event, '$.properties'), '$.campaign_name') AS campaign_name,  json_extract_scalar(json_extract(event, '$.properties'), '$.message_variation_name') AS message_variation_nameFROM  your_tableCROSS JOIN UNNEST(cast(JSON_PARSE(events) AS array(json))) AS t (event)

Examples

Example of Events Field

{
    "events": [
        {
            "event_type": "users.message.email.Open",
            "id": "a1234567-89ab-cdef-0123-456789abcdef",
            "time": 1477502783,
            "user": {
                "user_id": "user_id",
                "timezone": "America/Chicago"
        },
            "properties": {
                "campaign_id": "11234567-89ab-cdef-0123-456789abcdef",
                "campaign_name": "Test Campaign",
                "dispatch_id": "12345qwert",
                "message_variation_id": "c1234567-89ab-cdef-0123-456789abcdef",
                "email_address": "test@example.com",
                "send_id": "f123456789abcdef01234567",
                "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"
            }
        }
    ]
}

Example of the Treasure Data Console View of Ingested Braze Currents Events