# Connect Braze

You'll save visitors' answers to Braze and use their attributes, events, and purchases to personalize your website.

Available on the Pro plan.

Connect Braze to save what visitors tell you to their profiles. Once RightMessage identifies someone, you can also use their attributes, event history, and purchase data to show them relevant content on your website.

## Connect Braze

You'll need permission to edit your RightMessage project, a Braze REST API key, and your instance's REST endpoint. Use the API endpoint, not your dashboard URL. Check the region rather than copying another workspace's endpoint.

Ask your Braze administrator to allow the operations you'll use. These include user export and tracking, custom-attribute reads, and segment listing for the connection health check. You'll also need event and product catalog reads if you use those data sources. The key needs to read users as well as write them.

Each RightMessage project connects to one email platform or CRM. Review where you use an existing connection before replacing it.

1. Get your Braze REST API key and matching instance endpoint from your administrator or API settings.
2. In RightMessage, open your project's settings and select **Integration**.
3. Under **Email platforms & CRMs**, select **Braze**.
4. Enter the key in **API Key**.
5. Enter the full HTTPS base URL in **REST Endpoint**. Don't append an API route such as `/users/track`.
6. Click **Connect**.

![Braze connection controls in RightMessage, with no credentials entered](https://rightmessage.com/help/screens/integrations-braze-connection.light.webp)

Check connection health in **Overview**. This reads Braze's segment catalog. You'll test user reads and writes below. Use **Save Changes** to update credentials. There's no separate beta-enablement step.

[Install the RightMessage snippet](https://rightmessage.com/help/everything-you-need-to-know-about-your-rightmessage-tracking-script) on the website you'll test.

## Recognize subscribers from email links

Use `rm_braze` with the recipient's email. For example, a link to [WorkForge](https://workforge.rightmessage.com) could be:

```text
https://workforge.rightmessage.com/solutions.html?rm_braze={{${email_address}}}
```

Braze's [Liquid examples](https://www.braze.com/docs/user_guide/messaging/design_and_edit/personalize/liquid/liquid_use_cases) use `{{${email_address}}}` for the email attribute. Use your own page URL, then send a real test message so Braze fills in the email.

1. Add the parameter to a link to a page with RightMessage installed. Use `&rm_braze=` if the link already has query parameters, and put it before any `#` fragment.
2. Check that the delivered link contains the recipient's URL-encoded email, not the unresolved template.
3. Open it in a fresh browser session and check the profile in RightMessage's on-site debugger.

For links your developer builds, lookup also distinguishes a 24-character hexadecimal Braze ID from an external ID. Neither is a device ID. Email-based links let you test without depending on your application's external-ID format.

### If you use Braze's Web SDK

RightMessage can discover an email-shaped user ID returned by `braze.getUser().getUserId()`. This method doesn't automatically use a non-email external ID, and installing the SDK doesn't identify an anonymous browser.

When RightMessage learns an email, it can pass the email to Braze's SDK. That doesn't merge every device or anonymous profile. Another browser needs its own identification.

## Choose what to sync

Map questions and segment groups to custom attributes, not tags or segment membership. Choose an available destination from Braze's attribute catalog rather than typing an arbitrary name.

RightMessage reads native and custom attributes, total revenue, and event and purchase summaries for the last 90 days. Each summary includes a count and first and last timestamps, not a log of every occurrence. The 90-day window comes from [Braze's profile export](https://www.braze.com/docs/api/endpoints/export/user_data/post_users_identifier/).

Braze's segment catalog is used by the connection, but profile exports don't supply membership for normal segment conditions. To move someone into a Braze segment, update an attribute and let Braze's segment rules evaluate it. There's no writable list picker or answer-to-segment mapping.

### Pick a compatible field

The **Profile Field** destinations are:

| If you'd like to save… | Choose            | Field key    |
| ---------------------- | ----------------- | ------------ |
| A first name           | **First Name**    | `first_name` |
| A last name            | **Last Name**     | `last_name`  |
| A phone number         | **Phone**         | `phone`      |
| Gender                 | **Gender**        | `gender`     |
| A birth date           | **Date of Birth** | `dob`        |
| A country              | **Country**       | `country`    |
| A city                 | **City**          | `home_city`  |
| A language             | **Language**      | `language`   |
| A time zone            | **Time Zone**     | `time_zone`  |

Compatible input mappings can read and write these fields. Custom attributes support String, Number, Boolean, and Date. The picker excludes blocked attributes and Time, Object, Array, and Array of Objects types. Match the field's expected type. Dates are sent as date strings without converting them to a different format.

The attribute picker reads up to 50 pages of 50 attributes, or 2,500 before filtering, and caches the catalog for five minutes. Event and product pickers also stop at 50 pages, up to 12,500 event names and 5,000 product IDs. These are picker limits, not limits on a contact's events or purchases.

### Choose how to create contacts

For an Email question, choose **Create/Update contact** under **Contact action** and configure identification and consent. You don't need a list or hosted-form destination.

RightMessage first looks for the email in Braze. If it finds a profile, it uses that profile's external ID or Braze ID. If it doesn't, it creates an email-based user alias labeled `rightmessage`. It doesn't choose a new external ID for your application.

Braze can accept a write before the new profile becomes available to read. Allow for that delay rather than repeatedly creating profiles. Check the email, alias, and existing identifiers before repeating a failed signup test. If several profiles already share an email, have your team resolve them rather than expecting this connection to merge them.

### Check event actions separately

You can configure event actions with properties separately from attribute mappings. The server-side event request identifies the person by email. It doesn't include an external ID or Braze ID, even when those identifiers worked for a profile lookup. Check the event on the intended profile separately from a field update.

With Braze's Web SDK installed, RightMessage also calls `logCustomEvent` for `$rmWidget.displayed`, `$rmWidget.dismissed`, `$rmOffer.formSubmit`, `$rmOffer.clicked`, `$rmQuestion.answered`, and `$rmQuestion.openEnded`. These browser events are separate from a configured server-side action. They go to the SDK's current user, so check that identity if events and mapped attributes reach different profiles.

Follow [Map answers to contact fields and tags](https://rightmessage.com/help/synchronizing-contact-data-with-your-email-platform-or-crm), then publish the changes you want live.

## Check the connection

1. Give an existing test profile a distinctive supported attribute value.
2. Open its delivered identifying link in a fresh browser session. Check the profile and attribute in RightMessage's on-site debugger.
3. Outside debugger mode, submit a mapped answer on the live site. Check that the same Braze profile received it.
4. In another fresh session, submit a new test signup. Check its email and `rightmessage` alias in Braze, allowing for the read-after-write delay.
5. If you use event or purchase conditions, check those separately with a profile that has known data.

Debugger mode blocks external writes. When the intended profile's data reaches your website and the answer reaches that profile, the connection is working. If a check fails, follow [Verify an integration change](https://rightmessage.com/help/verify-an-integration-change).
