# Forward events to Braze
> Send Snowplow events to Braze for real-time personalization and campaign automation using the Track Users API with support for user attributes, custom events, and purchases.
> Source: https://docs.snowplow.io/docs/destinations/forwarding-events/integrations/braze/
> Documentation index: https://docs.snowplow.io/llms.txt

[Snowplow supported](/docs/destinations/#destinations-catalog "Built and supported by Snowplow") · Paid add-on · Event forwarder · Real time · AWS, Azure, GCP

Send Snowplow events to Braze for real-time personalization, user tracking, and campaign automation using Braze's [Track Users API](https://www.braze.com/docs/api/endpoints/user_data/post_user_track).

Snowplow supports the following Braze object types:

- **[User attributes](https://www.braze.com/docs/api/objects_filters/user_attributes_object)**: Profile data and custom user properties
- **[Custom events](https://www.braze.com/docs/api/objects_filters/event_object)**: User actions and behaviors
- **[Purchases](https://www.braze.com/docs/api/objects_filters/purchase_object)**: Transaction data with product details

## Prerequisites

Before setting up the forwarder in Console, you'll need the following from your Braze account:

- Braze REST API key with these permissions:

  - `users.track`
  - `users.alias.new`
  - `users.identify`
  - `users.export.ids`
  - `users.merge`
  - `users.external_ids.rename`
  - `users.alias.update`

- Braze REST API endpoint, found in Braze under **Settings** > **APIs and Identifiers**

## Getting started

### Configure the destination

To create the forwarder, follow the steps in [Creating forwarders](/docs/destinations/forwarding-events/creating-forwarders/).

When configuring the connection, select **Braze** for the connection type and enter your API key and endpoint.

When configuring the forwarder, you can choose from the following **Braze object types** to map:

- **[Attributes](https://www.braze.com/docs/api/objects_filters/user_attributes_object)**: update user profile data
- **[Events](https://www.braze.com/docs/api/objects_filters/event_object)**: send custom user actions
- **[Purchases](https://www.braze.com/docs/api/objects_filters/purchase_object)**: send transaction events

### Validate the integration

You can confirm events are reaching Braze by checking the following pages in your Braze account:

1. Query Builder: in Braze, navigate to **Analytics** > **Query Builder**. You can write queries on the following tables to preview the data forwarded from Snowplow: `USER_BEHAVIORS_CUSTOMEVENT_SHARED`, `USERS_BEHAVIORS_PURCHASE_SHARED`.
2. API Usage Dashboard: in Braze, navigate to **Settings** > **API and Identifiers** to see a chart of API usage over time. You can filter specifically for the API key used by Snowplow and see both successes and failures.

## Sending custom properties

You can send custom properties beyond the standard fields defined in the schema reference below. The structure depends on which Braze object type you're using:

- **User attributes**: add as top-level fields (e.g., `subscription_tier`, `loyalty_points`)
- **Event properties**: nest under `properties` object (e.g., `properties.plan_type`, `properties.feature_flag`)
- **Purchase properties**: nest under `properties` object (e.g., `properties.color`, `properties.size`)

For property names containing spaces, use bracket notation (e.g., `["account type"]` or `properties["campaign source"]`).

See Braze's [Event Object documentation](https://www.braze.com/docs/api/objects_filters/event_object) for details on supported data types, property naming requirements, and payload size limits. See [Creating forwarders](/docs/destinations/forwarding-events/creating-forwarders/) for details on configuring field mappings.

## Schema reference

The sections below contain information on the fields you can send to Braze, including field names, data types, required fields, and default Snowplow mapping expressions.

### User attributes

Use the user attributes object to update standard user profile fields or add your own custom attribute data to the user.

| Field                                     | Details                                                                                                                                                                                                                          |
| ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `_update_existing_only` _boolean_         | _Optional._ If `true`, API requests will only update existing user profiles in Braze. `false` recommended.Default mapping: `false`                                                                                               |
| `user_alias` _object_                     | _Optional._ Braze user alias object.Properties:* `alias_name` (string, required): The actual value of the alias identifier.
* `alias_label` (string, required): Indicates the type of alias. E.g. `domain_userid`.               |
| `external_id` _string_                    | _Optional._ A unique user identifier. Required if `user alias`, `braze_id`, `email`, or `phone` is not provided.Default mapping: `event?.user_id`                                                                                |
| `braze_id` _string_                       | _Optional._ Identifier reserved for the Braze SDK. Required if `external_id`, `user alias`, `email`, or `phone` is not provided. Not recommended for use with the Snowplow integration.                                          |
| `country` _string_                        | _Optional._ ISO-3166-1 alpha-2 standard standard country code. Where the value does not meet that standard, Braze attempts to map it to a country. Where it cannot, the value will be NULL.Default mapping: `event?.geo_country` |
| `current_location` _object_               | _Optional._Properties:* `longitude` (number, optional): Longitude of the user's location.
* `latitude` (number, optional): Latitude of the user's location.                                                                      |
| `date_of_first_session` _string_          | _Optional._ Date at which the user first used the app. Must be ISO 8601 format.                                                                                                                                                  |
| `date_of_last_session` _string_           | _Optional._ Date at which the user most recently used the app. Must be ISO 8601 format.                                                                                                                                          |
| `dob` _string_                            | _Optional._ The user's date of birth.                                                                                                                                                                                            |
| `email` _string_                          | _Optional._ The user's email address.                                                                                                                                                                                            |
| `email_subscribe` _string_                | _Optional._ The user's email subscription status. Must be one of: `opted_in`, `unsubscribed`, `subscribed`                                                                                                                       |
| `email_open_tracking_disabled` _boolean_  | _Optional._ Set to true to disable the open tracking pixel from being added to all future emails sent to this user.                                                                                                              |
| `email_click_tracking_disabled` _boolean_ | _Optional._ Set to true to disable the click tracking for all links within future emails sent to this user.                                                                                                                      |
| `first_name` _string_                     | _Optional._ User's first name.                                                                                                                                                                                                   |
| `gender` _string_                         | _Optional._ The user's gender. Must be one of: `M`, `F`, `O`, `N`, `P`, `null`                                                                                                                                                   |
| `home_city` _string_                      | _Optional._ The user's city.                                                                                                                                                                                                     |
| `language` _string_                       | _Optional._ The user's preferred language. Must be an ISO-639-1 standard language code.Default mapping: `event?.br_lang`                                                                                                         |
| `last_name` _string_                      | _Optional._ User's last name.                                                                                                                                                                                                    |
| `marked_email_as_spam_at` _string_        | _Optional._ Date at which the user’s email was marked as spam. Must be ISO 8601 format.                                                                                                                                          |
| `phone` _string_                          | _Optional._ The user's phone number.                                                                                                                                                                                             |
| `push_subscribe` _string_                 | _Optional._ The user's push message subscription status. Must be one of: `opted_in`, `unsubscribed`, `subscribed`                                                                                                                |
| `push_tokens` _array of object_           | _Optional._ Array of objects with app\_id and token string.                                                                                                                                                                      |
| `time_zone` _string_                      | _Optional._ The user's time zone. Must be a valid IANA Time Zone.Default mapping: `event?.geo_timezone`                                                                                                                          |

### Events

Each event object represents a single occurrence of a custom event by a particular user at the specific time. You can set and use custom event properties in messages, data collection, and personalization.

| Field                             | Details                                                                                                                                                                                                                                |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `time` _string_                   | _Required._ Time of the event, required. Must be ISO 8601 format.Default mapping: `spTstampToJSDate(event?.collector_tstamp)?.toISOString()`                                                                                           |
| `name` _string_                   | _Required._ Name of the type of event.Default mapping: `event?.event_name`                                                                                                                                                             |
| `external_id` _string_            | _Optional._ A unique user identifier. Required if `user alias`, `braze_id`, `email`, or `phone` is not provided.Default mapping: `event?.user_id`                                                                                      |
| `braze_id` _string_               | _Optional._ Identifier reserved for the Braze SDK. Required if `external_id`, `user alias`, `email`, or `phone` is not provided. Not recommended for use with the Snowplow integration.                                                |
| `phone` _string_                  | _Optional._ The user's phone number.                                                                                                                                                                                                   |
| `user_alias` _object_             | _Optional._ Braze user alias object.Properties:* `alias_name` (string, required): The actual value of the alias identifier.
* `alias_label` (string, required): Indicates the type of alias. E.g. `domain_userid`.                     |
| `_update_existing_only` _boolean_ | _Optional._ If `true`, API requests will only update existing user profiles in Braze. `false` recommended.Default mapping: `false`                                                                                                     |
| `email` _string_                  | _Optional._ The user's email address.                                                                                                                                                                                                  |
| `app_id` _string_                 | _Optional._ Associates activity with a specific app in your Braze workspace. If set, should match a Braze App Identifier, found in Braze console's API section. Can be omitted, but incorrect values may result in data loss in Braze. |
| `properties` _object_             | _Optional._ Arbitrary key-value pairs assigned to the event in Braze.                                                                                                                                                                  |

### Purchases

The purchase object represents a user purchasing a single item by a user at a particular time. Each purchase object is located within a purchase array, which can represent a transaction with multiple items. The purchase object has fields that allow the Braze back-end to store and use this information for messages, data collection, and personalization.

| Field                             | Details                                                                                                                                                                                                                                |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `time` _string_                   | _Required._ Time of the purchase, required. Must be ISO 8601 format.                                                                                                                                                                   |
| `product_id` _string_             | _Required._ Identifier for the product purchased.                                                                                                                                                                                      |
| `currency` _string_               | _Required._ ISO 4217 Alphabetic Currency Code.                                                                                                                                                                                         |
| `price` _number_                  | _Required._ Price per item.                                                                                                                                                                                                            |
| `external_id` _string_            | _Optional._ A unique user identifier. Required if `user alias`, `braze_id`, `email`, or `phone` is not provided.                                                                                                                       |
| `braze_id` _string_               | _Optional._ Identifier reserved for the Braze SDK. Required if `external_id`, `user alias`, `email`, or `phone` is not provided. Not recommended for use with the Snowplow integration.                                                |
| `phone` _string_                  | _Optional._ The user's phone number.                                                                                                                                                                                                   |
| `user_alias` _object_             | _Optional._ Braze user alias object.Properties:* `alias_name` (string, required): The actual value of the alias identifier.
* `alias_label` (string, required): Indicates the type of alias. E.g. `domain_userid`.                     |
| `_update_existing_only` _boolean_ | _Optional._ If `true`, API requests will only update existing user profiles in Braze. `false` recommended.                                                                                                                             |
| `quantity` _integer_              | _Optional._ Quantity of the item purchased. Braze treats this as multiple individual purchases.                                                                                                                                        |
| `email` _string_                  | _Optional._ The user's email address.                                                                                                                                                                                                  |
| `app_id` _string_                 | _Optional._ Associates activity with a specific app in your Braze workspace. If set, should match a Braze App Identifier, found in Braze console's API section. Can be omitted, but incorrect values may result in data loss in Braze. |
| `properties` _object_             | _Optional._ Arbitrary key-value pairs assigned to the purchase in Braze.                                                                                                                                                               |
