Guide to Connected Content in Braze

MHDG Staff Email Marketing, Marketing Automation

Braze’s personalization and dynamic content capabilities are in a class of their own in the lifecycle marketing platform space. Although implementing Braze requires some integration work from development teams, it unlocks the ability to do deep personalization and segmentation of users across multiple channels for both your web and mobile applications.

There are many built-in capabilities that allow for easy, one-click personalization, like inserting a custom first name. However, Braze’s most powerful yet most misunderstood personalization feature is Connected Content, which allows you to quickly reference and insert data from any accessible API endpoint for use in your content. 

What is Connected Content in Braze?

You might be asking, “why do I need to use Connected Content if I’ve already passed data into Braze for personalization?”

With Connect Content, you can reference any information accessible via your own web servers or public APIs in real time. For instance, if your company has a separate tool or database that stores product recommendations or a feed of news articles/content, you can reference it in your messaging channels without having to directly integrate, store, and update the content in Braze each time it changes. You can simply use Connected Content to get the most up to date info you want to reference right from its original source at the time your message is sent by Braze.

You can also reference data from third parties like openweather.org to look up information about the weather in your user’s area or other localized information that may not be stored in Braze.

Standard personalization in Braze requires all of that information to be stored directly in an event or on a custom attribute. Connected Content makes much more information available in real time.

Connected Content Examples and Use Cases

Still not exactly sure how your company could benefit from Connected Content? Let’s break it down with a few real examples we’ve used for our clients.

Connected Content Example: Abandoned Cart Lookup

This email from Flip.shop had both a real-time cart look up, as well as a real-time calculation of their cart contents minus any rewards they had accumulated.

If you’re an ecommerce company, the abandoned cart workflow is part of your lifecycle marketing bread and butter. If you use Braze to build out an abandoned cart email sequence, you likely have an event to trigger the canvas like a ‘started_checkout’ or ‘added_item_to_cart’. You may even have the current cart contents as properties of the event. But what if the user adds or removes items?

Without Connected Content, you can only use the information available in the event to populate your email or push messaging, and if your canvas runs for a few days, those items in the user cart may change or even run out of stock. The alternative is to keep your messaging generic, or build a convoluted process to continually pass updated cart information as a stored user attribute in Braze, which can get really complicated when you’re talking about an array of objects in a user cart.

With Connected Content, the process is quite simple. You’ll still want your events to trigger your canvas, but the only property the event needs is a cartID. From there, you can pass the cartID to the Connected Content API endpoint, which can return any/all of the information you want about the cart for use in your email. By using Connected Content, you don’t have to worry about storing the cart details in an attribute or event in Braze or the cart contents being out of date.

Whether you send the message 5 minutes or 5 weeks after someone starts checkout, each time you use the Connected Content lookup to personalize content, the personalization is based on a real-time lookup right before the message is sent to the user.

Connected Content Example: User Recommendations

For Ritual, we passed restaurant recommendations with dynamic links in lifecycle emails and push messages

A client of ours is a takeout food-ordering app with an in-app recommendation engine based on where the user is currently located, the time of day, what restaurants are open around them, and a few other proprietary factors.

Because of how frequently a user may move around during the day in combination with nearby restaurants opening & closing throughout the day, sending information about restaurant recommendations through simply leveraging custom attributes would be next to impossible and the recommendations would become stale very quickly.

With Connected Content, we pass the user’s ID to the Connected Content API endpoint that is used to populate the in-app recommendations which then returns the handful of restaurant recommendations to feature within a push or email notification.

Connected Content Example: Loyalty/Reward User Credit Lookup

The same client of ours has a reward system that awards users with credits based on various types of engagement with the platform. These credits can be used as dollars off future purchases, sometimes even resulting in free meals.

We want to remind users of their credits as a way to drive incremental purchases, but because some of them expire and have other limiting T’s & C’s, we have to be able to communicate exactly how many credits are available and applicable for a user at any given moment.

Without Connected Content, we would have to keep the language very nebulous, a la ‘You’ve got credits – go order before they expire!’, regardless of whether those credits were worth $1 or $100 to the user. This more generic messaging does not tend to drive significant action.

With Connected Content, we can reference all of the available, applicable credits a user has at a given moment. When we combine that with Liquid If/Else and Abort logic, we can do things like drive urgency by alerting them of credits that expire soon or abort the message entirely if they only have a minimal amount of credits available.

What do I need to set up for Connected Content?

To get started with Connected Content, you’ll need only a handful of things (along with a few hours of your developer’s time!).

Step 1:

Get the endpoint URL, parameters to pass, and an example payload from the developer. Fear not! Although these sound very technical, they can be easily explained.

  • The API endpoint is simply the URL you need to reference to get the information from your internal systems (and your developer will know what you’re talking about 🙂)
  • The parameters to pass are the inputs you need to provide to get your desired output. For this, you’ll first need to know if you need to make either a GET request or a POST request for the API call. Then, for the example with the user-specific restaurant recommendations above, we need to provide the recommendation endpoint a user ID (i.e. the input) to look up as part of that call – and that’s it! The system then uses that ID to identify the recommendations for that particular user and pass it back into Braze. These parameters can get a little more complex depending on what exactly you need to pull through Connected Content, but at a basic level, a customer ID is typically a great start.
  • The “example payload” is a fancy way of referring to the output of the API call after we pass the parameter(s), which will include both the call and anticipated response. The call example helps us understand the format of the information that’s passed back so we can appropriately reference it in our message. 

Step 2:

Once you have your API endpoint, your inputs (parameters) and call examples (response), you’ll need to make sure that you have authentication set up to gain access to the endpoint. The majority of API endpoints have authentication-based access so that only those approved can access the data and not jam up the system with bad or unnecessary requests. You can read more about the types of authentication here.

Your developer can follow the steps linked above to set up authentication in Braze for you to make your Connected Content calls.

Step 3: 

Lastly, you’ll need to make sure that Braze is a whitelisted partner for the API endpoints you setup. You can find the IPs to share with your developer to ensure they’re whitelisted here.

That’s it! That’s all you actually need to get a basic Connected Content set up. Let’s figure out how to use it next.

Are your eyes starting to glaze over and just need someone to talk with your developers and get this implemented? We get it! Feel free to get in touch with us and see if we are a good fit to be your Braze Connected Content experts. And if you want to vet our expertise, have a look at our guide on How to Hire a Braze Expert.

How do I implement Connected Content in a message?

Once you have your Connected Content setup done, you can begin implementation. 

The key steps in this process are to create your message, test the Connected Content call, and confirm the response is what you anticipated with your developer.

First, create an HTML email template in Braze, and insert your API call at the top of your <body> tag. See below for the API call used for the user-specific restaurant recommendation example described above:

{% connected_content http://clientapiendpoint.co/v2/users/recommendations?external_id={{${user_id} | url_param_escape}}&num_recommendations=1
:basic_auth connected-content-prod
:content_type application/json
:method get
:save response %}

Let’s break this down for you to understand a bit more of the HTML/Liquid being written here:

{% connected_content http://clientapiendpoint.co/v2/users/recommendations?external_id={{${user_id} | url_param_escape}}&num_recommendations=1

The first part here is joining the Connected Content Liquid call with our client’s API endpoint URL and parameters at the end as GET variables.

external_id={{${user_id} | url_param_escape}}

This line is what looks for a user’s external_id in that endpoint URL, which corresponds to the Braze user_id attribute. We’re also doing a character escape parameter to ensure any email addresses used as user ID’s don’t break the API call.

&num_recommendations=1

This line limits the response to one (1) restaurant recommendation per user. We will be sending a push notification, so only one output is needed for this use case. We’ve built emails where we recommend up to 6 restaurants. In those calls, the code would end in 6 instead of 1.

:basic_auth connected-content-prod
:content_type application/json
:method get

This section is used for defining and allowing authentication with the server so it knows it’s your Braze account trying to access the data. We set up a basic authentication credential called “connected-content-prod” for our client, so in this particular code, we’re telling the client API server, “this is the MH team attempting to access the API endpoint!”. The content_type simply tells the webserver what language we’re using to pass our parameters into the API call. Method “get” is the protocol we’re using for this particular call (which is why we needed to determine if the sample call used POST or GET earlier! 🙂).

:save response %}

The last portion of our connected content call is telling our message (in this case, push notification) what variable to temporarily save from the information that’s returned in the API response. We simply refer to it as the ‘response’ in this example.

Here’s an example of what the output looks like from the above Connected Content call to help contextualize what we do next:

Our test user was recommended Rush Hour Bar

As you can see in the example, we are looking only for the restaurant name to include in our push notification, which is called the MERCHANT_NAME in the Connected Content response. 

In order to get the restaurant name out of our ‘response’ variable from above, we use json object notation to refer to that attribute using the following code:

{{response.[0].MERCHANT_NAME}

which simply means for the first object in the response (the first recommendation, in this example), pull in the merchant name. 0 is noted as the first variable in an array.

There are some users who don’t have any restaurant recommendations for a variety of reasons. For this reason, it’s always a good idea to have fallback content ready if the Connected Content API call does not return what’s expected, or the call fails because of a server issue. In this case, we don’t want to have a blank recommendation sent as a push notification.

To accomplish this, we add the following code to abort the message if nothing is returned:

{% if response.[0].MERCHANT_NAME == nil %}
     {% abort_message() %}
   {% endif %}

implified, this says that if the first merchant name in the response does not exist, either because the call failed, nothing was ever returned, or the return didn’t include a merchant name, then abort the message entirely.

implified, this says that if the first merchant name in the response does not exist, either because the call failed, nothing was ever returned, or the return didn’t include a merchant name, then abort the message entirely. Adding an abort message with conditional logic to your Connected Content messaging is strongly recommended.

In full, the entire code for the body of the push message looks like this:

{% connected_content http://clientapiendpoint.co/v2/users/recommendations?external_id={{${user_id} | url_param_escape}}&num_recommendations=1
:basic_auth connected-content-prod
:content_type application/json
:method get
:save response %}

{% if response.[0].MERCHANT_NAME == nil %}
     {% abort_message() %}
   {% endif %}
Can’t decide what to order first? We think {{response.[0].MERCHANT_NAME}} would be a great choice. 😉 T&Cs apply.

Testing your Connected Content:

When you’ve got your Connected Content implementation ready, test it with a few internal users. Take note to confirm it’s accurate and also test some users that will not return a Connected Content API response to confirm that your abort message logic works as intended.

There you have it! You’ve implemented Connected Content and have become a Braze personalization expert.

A Pitch for MH Digital as your Braze Expert

Still not exactly sure how this stuff all works or don’t have the time to figure it out amongst the other responsibilities? We’ve implemented Connected Content with nearly every Braze client we’ve worked with. Have a look at our full suite of Braze services and let us know if you need to bring in the experts to help!