Skip to content

Recommending products to users

Use the Braze REST API alongside catalogs or Connected Content to surface personalized product recommendations in your messages. This approach lets you plug your own recommendation engine into the Braze messaging ecosystem, so non-technical users can own the content and messaging surrounding each recommendation.

With this approach, you can:

  • Store product recommendations on user profiles from your backend using the REST API.
  • Retrieve product metadata at send time using catalogs or Connected Content.
  • Display personalized recommendations across any messaging channel, including email, push, in-app messages, and more.

Prerequisites

To complete this guide, you need:

Step 1: Store recommendations on user profiles

To begin, store the product recommendations generated by your recommendation engine on Braze user profiles as custom attributes. This lets you reference each user’s recommended products at message send time.

  1. Determine which recommendation data to store, such as product IDs or preferred categories.
  2. Use the /users/track endpoint to write the recommendation as a custom attribute on the user profile.

Example request

1
2
3
POST YOUR_REST_ENDPOINT/users/track
Content-Type: application/json
Authorization: Bearer YOUR_REST_API_KEY

Replace YOUR_REST_ENDPOINT with the REST endpoint URL for your workspace.

1
2
3
4
5
6
7
8
{
  "attributes": [
    {
      "external_id": "user123",
      "recommended_product_id": "1001"
    }
  ]
}

Use meaningful attribute names (such as recommended_product_id) so they’re easy to reference in Liquid templates later. Keep recommendations accurate by updating them regularly as your recommendation engine produces new results.

Step 2: Retrieve product metadata

After storing a recommendation identifier on each user profile, you need to retrieve the full product metadata (name, price, image, and so on) to include in your message. You have two options:

  • Option A: Braze catalogs — store product information directly in Braze for fast, built-in lookups.
  • Option B: Connected Content — fetch product information from an external API at send time.

Option A: Braze catalogs

If you’ve created a catalog with your product inventory, you can look up items directly in your message using Liquid. For a full walkthrough, see Using catalogs.

Recommend a specific catalog item

To reference a specific product by ID, use the catalog_items Liquid tag. For example, to recommend product 1001 from a catalog named retail_products:

1
2
3
4
5
6
{% catalog_items retail_products 1001 %}

We have a new item we think you'll like:
Category: {{ items[0].category }}
Name: {{ items[0].name }}
Price: ${{ items[0].price }}

Recommend multiple catalog items

You can also reference multiple items in a single tag. For example, to feature three products:

1
2
3
4
5
6
7
8
{% catalog_items retail_products 1001 1003 1005 %}

New items added in:
- {{ items[0].category }}
- {{ items[1].category }}
- {{ items[2].category }}

Visit our store to learn more!

Template items using a user’s recommendation

Combine the custom attribute from Step 1 with a catalog lookup to personalize the recommendation for each user:

1
2
3
4
{% catalog_items retail_products {{custom_attribute.${recommended_product_id}}} %}

Hi {{${first_name}}}, check out our pick for you:
{{ items[0].name }}  ${{ items[0].price }}

Option B: Connected Content

If your product metadata lives in an external service rather than a Braze catalog, use Connected Content to fetch it at send time.

For example, if your internal API returns product details by ID:

1
2
3
4
{% connected_content https://api.yourcompany.com/products/{{custom_attribute.${recommended_product_id}}} :save product %}

Hi {{${first_name}}}, we think you'll love:
{{ product.name }} — ${{ product.price }}

For more details on making API calls from your messages, see Making an API call.

Step 3: Verify your integration

After completing the setup, verify your integration:

  1. Use the /users/track endpoint to write a test recommendation to your own user profile.
  2. Send a test message that references the recommended product using either Catalogs or Connected Content.
  3. Confirm the product details render correctly in the delivered message.
  4. In the Braze dashboard, go to the campaign or Canvas results page and confirm the send is recorded.

Considerations

  • Keep recommendation data accurate by updating custom attributes regularly as your recommendation engine produces new results.
  • Use Braze personalization features to further tailor messages, such as incorporating user-specific data alongside product details.
  • Consider using API-triggered delivery to trigger messages from your backend using templates defined in the Braze dashboard.
New Stuff!