Skip to contentSkip to navigationSkip to topbar
On this page
Looking for more inspiration?Visit the
(information)
You're in the right place! Segment documentation is now part of Twilio Docs. The content you are used to is still here—just in a new home with a refreshed look.

Using Linked Audiences with Braze


FREE x
TEAM x
BUSINESS
ADDON
(new)

This is a beta feature

This feature is in active development and might change before general availability.

Linked Audiences lets you dynamically personalize email messages(link takes you to an external page) in Braze using the predefined traits of any Linked Audience profile and the attributes of any entities used to match the profile into the audience.


Supported Braze engagement tools

supported-braze-engagement-tools page anchor

The following engagement tool is available for use with Linked Audiences in Segment:

TypeDescription
Action-based Campaigns(link takes you to an external page)Trigger and dynamically personalize campaigns with rich entity context.

Segment Destination Actions

segment-destination-actions page anchor

Segment sends data from your Linked Audiences to actions-based destinations. For example, you could send account information for the audience profiles with past due accounts to an email platform.

You can configure multiple triggers per audience (for example, one for account entry, and one for account exit).

Segment Destination ActionHow does it work?How does Braze store the data?Braze API Endpoint
Track EventSegment sends personalization payload information into Braze as Braze Profile custom events(link takes you to an external page). The entity personalization payload is contained in the events parameter within API calls. Segment appends Profile Traits as objects (or event properties) and Entity Context as nested objects.Event objects(link takes you to an external page) or Nested objects in custom events(link takes you to an external page)track API endpoint(link takes you to an external page)
Update User ProfileSegment sends personalization payload information into Braze as Braze profile custom attributes(link takes you to an external page). The entity personalization payload is contained in the attributes parameter in API calls.User attributes object(link takes you to an external page) or Nested Custom Attributes(link takes you to an external page)track API endpoint(link takes you to an external page)

Braze action-based delivery campaign

braze-action-based-delivery-campaign page anchor

Braze's action-based delivery campaigns(link takes you to an external page) store the entity personalization payload as nested objects in custom events(link takes you to an external page).

Prerequisites

prerequisites page anchor

Complete the following setup steps before you configure an action based delivery campaign in Braze.

In Segment, make sure you have:

In Braze, make sure you have:

Step 1. Set up a Braze action-based delivery campaign

step-1-set-up-a-braze-action-based-delivery-campaign page anchor

To use Linked Audiences you must set up an action-based delivery campaign in Braze.

In Braze, do the following:

  1. Create a new email Campaign(link takes you to an external page).
  2. Create an email using the HTML Editor(link takes you to an external page) and personalize it using Liquid tags(link takes you to an external page).
    1. Reference your personalization payload schema from Segment to determine what properties to include in your message.
    2. Translate the Segment event properties in the payload schema into Liquid syntax for custom events(link takes you to an external page), and enter it in the Braze HTML editor. See the following personalization examples for more details on how you can personalize your campaign.
  3. Next, schedule your campaign delivery(link takes you to an external page):
    1. Select Action-based delivery(link takes you to an external page) > New Trigger Action(link takes you to an external page): Perform Custom Event(link takes you to an external page) > Add Trigger.
    2. Search for and select the name of the Segment custom event you previously set up and tested in Segment.
    3. Select Delivery Controls > Allow users to become re-eligible to receive campaigns(link takes you to an external page) checkbox, and select 0 minutes. This is necessary for Step 2. Test your campaign flow so that you don't have to wait for a user to become re-eligible while testing. You can adjust these settings after you have finished testing.
  4. Select your target Audience:
    1. Add a filter to target users without a segment(link takes you to an external page).
    2. Search for and select the name of the Segment custom event you previously set up and tested in Segment.
    3. Select More than 0 times as the timeframe for this filter.
  5. Update any additional settings that apply to your campaign, then review and deploy(link takes you to an external page) your campaign and continue to Step 2: Test your campaign flow.

Step 2. Test your campaign flow

step-2-test-your-campaign-flow page anchor

Open the Segment app and send yourself a test email for review. Add your Braze user id and click Send test event to destination. Review the email you received, and ensure it is formatted properly.

A screenshot of the test event page.
  1. If the event is sent successfully to Braze, you will see a "message": "success" response in Segment.
  2. Open Braze and check your campaign dashboard(link takes you to an external page) (Braze > [Your Unique Campaign] > Analytics) to confirm that Braze sent the message. It can take up to 15 minutes for Braze to send the email.
  3. If your email doesn't look the way you want it to, adjust the Liquid syntax(link takes you to an external page) in Braze and send another test event in Segment. See the following personalization examples for more specific details.
  4. When you're finished testing your campaign, proceed to Enable your Linked Audience.

Liquid examples to use in Braze

liquid-examples-to-use-in-braze page anchor

Use the following examples as context and information to experiment with setting up your campaign in Braze.

The following is an example of what your payload data might look like with nested payload properties:

1
{
2
"event": "abandoned_carts_linked_audience",
3
"properties": {
4
"first_name": "Andrew",
5
"last_name": "Shopper",
6
"shopping_cart__id": "123",
7
"shopping_cart__products": [
8
{
9
"id": "324",
10
"product_name": "Premium Tennis Shoes",
11
"product_price": "$140",
12
"__entity": "product"
13
},
14
{
15
"id": "489",
16
"product_name": "Premium Jacket",
17
"product_price": "$200",
18
"__entity": "product"
19
}
20
],
21
"__entity": "cart"
22
}
23
}

The following helps translate your payload data into Liquid syntax:

  • To reference a specific event property:
    • Use the following liquid syntax: {{event_properties.event_property_name}}
    • An example of this property might look like: {{event_properties.first_name}}
  • To reference nested event properties within an Array:
    • Use the following liquid syntax: {{event_property_name.[#_that_represents_specific_entry_in_array].nested_event_property_name }}
    • An example of this property might look like: {{event_properties.shopping_cart__products[0].product_name}}

Use the Segment payload data you copied when setting up your Linked audience to build an abandoned cart email campaign that includes specific information for the product in a customer's shopping cart.

When an email is sent, it lists the specific product and its related price in your customer's shopping cart. It might look like the following screenshot:

A screenshot of an email, with the name, item, and price personalized.

This is an example of what your email formatted using HTML(link takes you to an external page) and Liquid(link takes you to an external page) might look like in Braze:

1
Hi {{event_properties.first_name}},
2
<br />
3
<br />
4
Did you forget to checkout?<br />
5
<br />
6
We noticed you added some items to your shopping cart including this item: <br />
7
<br />
8
<b>Product Name: </b>
9
{{event_properties.shopping_cart__products[0].product_name}}
10
<br />
11
<b>Product Price: </b>
12
{{event_properties.shopping_cart__products[0].product_price}} USD
13
<br />
14
<br />
15
16
Quick, now is your chance to own this item before it sells out!

Use the Segment payload data you copied when setting up your Linked audience to build an abandoned cart email campaign where you can use an iteration tag(link takes you to an external page) to run a block of code repeatedly. In this example, you can use a for loop to list all of the products and their related prices in a customer's shopping cart.

When an email is sent, it lists all of the products and their related prices in your customer's shopping cart. It might look like the following:

A screenshot of an abandoned cart email, with a personalized name, two items, and prices for those items.

This is an example of what your email formatted using HTML(link takes you to an external page) and Liquid(link takes you to an external page) might look like in Braze:

1
Hi {{event_properties.first_name}},
2
<br />
3
<br />
4
Did you forget to checkout?<br />
5
<br />
6
We noticed you added some items to your shopping cart. Here's what you left: <br />
7
<br />
8
9
{% for products in event_properties.shopping_cart__products %}
10
<b>Product Name: </b>
11
{{products.product_name}}
12
<br />
13
<b>Product Price: </b>
14
{{products.product_price}} USD
15
<br />
16
<br />
17
18
{%endfor%}
19
20
Quick, now is your chance to own these items before they sell out!