All Collections
Braze
Braze - Broadcast message experiments with dynamic optimization
Braze - Email - Broadcast Dynamic Optimization - Content Block Preparation
Braze - Email - Broadcast Dynamic Optimization - Content Block Preparation

Prepare your Braze Content Block for use with your Phrasee experiments

Updated over a week ago

With your Phrasee token and Braze Currents set up, you're ready to move on to getting your email ready.

Arguably the most important piece of this Dynamic Optimization integration is the content blocks and code snippets you'll need to create.

Our integration leverages a Braze feature known as Connected Content. If you're not familiar with Connected Content, check out Braze's documentation to read all about it.

We've created code snippets that work with Braze's Connected Content to dynamically pull language and a tracking pixel into your emails so we can optimize your language in real time.

Part of the code snippet is reusable and will be placed in a Content Block, which is what we'll explore below. If you'd like to read up on Content Blocks before continuing, please see Braze's Content Block documentation.

Written walkthrough

1. Navigate to the Content Blocks Library in Braze

You can find the Content Blocks Library under the Engagement section of the navigation bar on the left side of your screen in Braze.

Navigate to Engagement > Templates & Media > Content Blocks Library.

2. Create a new HTML Content Block

Click Create Content Block and then HTML Content Block from the dropdown that appears.

The Content will not render correctly if a drag-and-drop Content Block is created.

3. Paste the Connected Content code snippet into the HTML editor

You'll need to paste the following Connected Content code snippet into the HTML editor of your new Content Block:

{% connected_content https://realtime.phrasee.co/live/single_variant?campaign_id={{phraseeExperimentId}}&delivery_id={{campaign.${dispatch_id}}}&recipient_id={{${user_id}}} :method get :headers { "Authorization": "Bearer <token>" } :content_type application/json :no_cache :rerender :save variants %}

4. Add in your API token

With this pasted, you'll notice there is a critical piece of data you'll need to add into the snippet: the API token.

Your token should be accessible for the admin(s) of your account, via the Admin > Settings menu. If you're not sure where to find your token, we've got an article for that.

With your token in hand, paste it over the <token> placeholder in the code snippet, including the crocodile brackets but leaving the space before it and the quotation marks after it intact.

Your code snippet should look something like this with your token in place:

Click Done.

5. Name and launch your Content Block

Make sure you give the Content Block a sensible, unique, descriptive name for easy location when adding it to your messages. It is best to have no spaces or special characters in the name. You'll note in our example below we've chosen the name phraseeContent.

Click Launch Content Block when you're happy with your changes.

Continue on the article path below to move on to message configuration.


Article path

Related articles

Page last reviewed: April 10, 2024

Did this answer your question?