Page tree
Skip to end of metadata
Go to start of metadata

The Braze platform provides insight into new growth opportunities and brand interactions that can help you build transformative campaigns and take strategic actions. Treasure Data supports the Braze platform by allowing you to write job results from Treasure Data directly to Braze. 

 What can you do with this Integration?

  • Map external ids: For example, you can map ids from your CRM system to the Braze user account. 

  • Opt-out: When an end-user updates the consent choosing not to participate.

  • Upload your own tracking of events, purchases, or custom profile attributes. This information can help you build precise customer segments that enhance the user experience for your campaigns.


Prerequisites

  • Basic Knowledge of Treasure Data.

  • Basic knowledge of Braze.

Obtain Rest API Key in Braze

  1. Go to Braze dashboard and enter the development console.
  2. Go to the API setting tab and create a new Rest API key.

Use the TD Console to Create Your Connection

Create a New Connection

In Treasure Data, you must create and configure the data connection before running your query. As part of the data connection, you provide authentication to access the integration.

  1. Open TD Console.

  2. Navigate to Integrations Hub Catalog.

  3. Search for and select Braze.

  4. Type the credentials to authenticate.

  5. Type a name for your connection.

  6. Select Done.

Define your Query


  1. Complete the instructions in Creating a Destination Integration.
  2. Navigate to Data Workbench > Queries.

  3. Select a query for which you would like to export data.

  4. Run the query to validate the result set.

  5. Select Export Results.

  6. Select an existing integration authentication.
  7. Define any additional Export Results details. In your export integration content review the integration parameters.
    For example, your Export Results screen might be different, or you might not have additional details to fill out:
  8. Select Done.

  9. Run your query.

  10. Validate that your data moved to the destination you specified.


Integration Parameters for Braze

The export results parameters are described in the table following the image.

ParameterValuesDescription
modeuser_new_alias,
user_identifying,
user_track,
user_delete
Connector mode
track_record_typecustom_events,
purchases,
user_profile_attributes
Record type for user_track mode
pre_formated_fieldsStringUse for array or JSON columns to keep the format.
skip_on_invalid_recordsBooleanIf enabled, continue and ignore the fail records for the JSON column.
Otherwise, the job stops.

Example Query

SELECT external_id, alias_name, alias_label FROM table create_user_alias


ModeTrack Record TypeColumns
user_new_alias

Supported columns:

  • external_id
  • alias_name
  • alias_label

Other columns are ignored.

user_identifying

Supported columns:

  • external_id
  • alias_name
  • alias_label

Other columns are ignored

user_trackcustom_events

Required columns:

  • external_id or (alias_name, and alias_label) or braze_id
  • name, time

Other aliases are sent as is

user_trackpurchases

Required columns:

  • external_id or (alias_name, and alias_label) or braze_id
  • product_id, currency, price, time

Other aliases are sent as is

user_trackuser_profile_attributes

Required columns:

  • external_id or (alias_name, and alias_label) or braze_id

Other aliases are sent as is

user_delete

Required columns:

  • external_id or (alias_name, and alias_label) or braze_id

Optionally Schedule the Query Export Jobs

You can use Scheduled Jobs with Result Export to periodically write the output result to a target destination that you specify.


1. Navigate to Data Workbench > Queries.
2. Create a new query or select an existing query.
3. Next to Schedule, select None.

4. In the drop-down, select one of the following schedule options.

Drop-down ValueDescription
Custom cron...

Review Custom cron... details.

@daily (midnight)Run once a day at midnight (00:00 am) in the specified time zone.
@hourly (:00)Run every hour at 00 minutes.
NoneNo schedule.

Custom cron... Details

Cron Value

Description

0 * * * *

Run once an hour

0 0 * * *

Run once a day at midnight

0 0 1 * *

Run once a month at midnight on the morning of the first day of the month

""

Create a job that has no scheduled run time.

 *    *    *    *    *
 -    -    -    -    -
 |    |    |    |    |
 |    |    |    |    +----- day of week (0 - 6) (Sunday=0)
 |    |    |    +---------- month (1 - 12)
 |    |    +--------------- day of month (1 - 31)
 |    +-------------------- hour (0 - 23)
 +------------------------- min (0 - 59)

The following named entries can be used:

  • Day of Week: sun, mon, tue, wed, thu, fri, sat

  • Month: jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec

A single space is required between each field. The values for each field can be composed of:

Field ValueExampleExample Description

a single value, within the limits displayed above for each field.



a wildcard ‘*’ to indicate no restriction based on the field. 

‘0 0 1 * *’ configures the schedule to run at midnight (00:00) on the first day of each month.
a range ‘2-5’, indicating the range of accepted values for the field.‘0 0 1-10 * *’ configures the schedule to run at midnight (00:00) on the first 10 days of each month.
a list of comma-separated values ‘2,3,4,5’, indicating the list of accepted values for the field.

0 0 1,11,21 * *’


configures the schedule to run at midnight (00:00) every 1st, 11th, and 21st day of each month.
a periodicity indicator ‘*/5’ to express how often based on the field’s valid range of values a schedule is allowed to run.

‘30 */2 1 * *’


configures the schedule to run on the 1st of every month, every 2 hours starting at 00:30. ‘0 0 */5 * *’ configures the schedule to run at midnight (00:00) every 5 days starting on the 5th of each month.
a comma-separated list of any of the above except the ‘*’ wildcard is also supported ‘2,*/5,8-10’‘0 0 5,*/10,25 * *’configures the schedule to run at midnight (00:00) every 5th, 10th, 20th, and 25th day of each month.
5.  (Optional) If you enabled the Delay execution, you can delay the start time of a query.

Execute the Query

Save the query with a name and run, or just run the query. Upon successful completion of the query, the query result is automatically imported to the specified container destination.


Scheduled jobs that continuously fail due to configuration errors may be disabled on the system side after several notifications.



Optionally Configure Export Results in Workflow

Within Treasure Workflow, you can specify the use of this data connector to export data.

Learn more at Using Workflows to Export Data with the TD Toolbelt.

Example Workflow


_export:
  td:
  database: td.database

+braze_export_task:
  td>: export_braze.sql
  database: ${td.database}
  result_connection: braze
  result_settings:
    type: braze
    mode: user_track
    track_record_type: custom_events
    pre_formatted_fields: array,json
    skip_on_invalid_records: false


















  • No labels