Skip to content

Braze

Braze is a customer engagement platform for cross-channel messaging and customer analytics.

Bruin supports Braze as a source for Ingestr assets, and you can use it to ingest data from Braze into your data warehouse.

To set up a Braze connection, you need a REST API key and your instance's REST endpoint. For more information, please refer here

Follow the steps below to correctly set up Braze as a data source and run ingestion:

Configuration

Step 1: Add a connection to .bruin.yml file

To connect to Braze, you need to add a configuration item to the connections section of the .bruin.yml file. This configuration must comply with the following schema:

yaml
    connections:
      braze:
        - name: "my_braze"
          api_key: "YOUR_BRAZE_REST_API_KEY"
          endpoint: "rest.iad-01.braze.com"
  • api_key: A Braze REST API key with access to the relevant export endpoints. Required.
  • endpoint: Your instance's REST endpoint host (e.g. rest.iad-01.braze.com). Braze is multi-instance, so the host depends on which cluster your account is on. Required.

Step 2: Create an asset file for data ingestion

To ingest data from Braze, you need to create an asset configuration file. This file defines the data flow from the source to the destination. Create a YAML file (e.g., braze_ingestion.yml) inside the assets folder and add the following content:

yaml
name: public.braze
type: ingestr
connection: postgres

parameters:
  source_connection: my_braze
  source_table: 'campaigns'
  destination: postgres
  • name: The name of the asset.
  • type: Specifies the type of the asset. It will be always ingestr type for Braze.
  • connection: This is the destination connection.
  • source_connection: The name of the Braze connection defined in .bruin.yml.
  • source_table: The name of the data table in Braze you want to ingest. For example, campaigns would ingest campaign records.

Available Source Tables

TablePKInc KeyInc StrategyDetails
campaignsidlast_editedmergeMarketing campaigns (including archived) with their name, tags, and API flags.
campaign_seriestime, campaign_idtimemergeDaily per-campaign stats (conversions, revenue, unique recipients; per-channel detail in a messages column). Fetches all campaigns by default; an optional campaign_series:<id>[,<id>] filter limits it.
canvasesidlast_editedmergeCanvas (journey) definitions (including archived) with their name and tags.
canvas_seriestime, canvas_idtimemergeDaily per-canvas (journey) stats (entries, conversions, revenue). Fetches all canvases by default; an optional canvas_series:<id>[,<id>] filter limits it.
segmentsid-replaceAudience segments with their name and analytics-tracking flag.
segment_seriestime, segment_idtimemergeDaily size per segment. Fetches all segments by default; an optional segment_series:<id>[,<id>] filter limits it.
eventsname-replaceCustom events catalog: name, description, status, tags, and analytics-report flag.
event_seriestime, event_nametimemergeDaily occurrence count per custom event. Fetches all events by default; an optional event_series:<name>[,<name>] filter limits it.
productsproduct_id-replaceProduct IDs seen in purchase events.
sessionstimetimemergeDaily session count.
purchase_quantitytimetimemergeDaily total number of purchases.
purchase_revenuetimetimemergeDaily total revenue.
kpi_dautimetimemergeDaily active users by date.
kpi_mautimetimemergeMonthly active users (rolling 30-day) by date.
kpi_new_userstimetimemergeNew users by date.
kpi_uninstallstimetimemergeApp uninstalls by date.
user_databraze_id, segment_id-replaceSegment users with their email/push subscription state and profile fields (a point-in-time snapshot). Exports all segments by default; an optional user_data:<id>[,<id>] filter limits it.

The kpi_* tables aggregate across all apps by default. Append a comma-separated list of app identifiers to break a KPI down by app, e.g. source_table: 'kpi_dau:app-one-id,app-two-id'; each row then carries an app_id column.

The user_data table exports segment users along with their subscription state. By default it exports every segment; pass a comma-separated list of segment ids to limit it, e.g. source_table: 'user_data:<segment_id>' or 'user_data:<segment_id_1>,<segment_id_2>'. Find segment ids by ingesting the segments table (its id column) or in the Braze dashboard. Each row is tagged with the segment_id it came from.

WARNING

Exporting all segments runs one async export per segment (each can take minutes to materialize) and can produce a very large, heavily duplicated dataset (the same user appears in every segment they belong to). Prefer naming the specific segments you need.

NOTE

The events table now uses the name column as its primary key (previously event_name). If you ingested events before this change, drop the destination table once so it is recreated with the new column.

Step 3: Run asset to ingest data

bash
bruin run ingestr.braze.asset.yml

As a result of this command, Bruin will ingest data from the given Braze table into your Postgres database.