Skip to main content
All CollectionsIntegrationsKlaviyo Integration
How to Create a Product Feeds with Rebuy Recommendations in Klaviyo
How to Create a Product Feeds with Rebuy Recommendations in Klaviyo

Follow this help article to add Rebuy recommendations to your Klaviyo campaigns.

Strauss Van Wagenen avatar
Written by Strauss Van Wagenen
Updated over a month ago

Overview

Integrating Rebuy recommendations into your Klaviyo campaigns can significantly enhance your email marketing efforts. This guide will walk you through the steps to enable the integration, create the necessary events, specify the Data Source for recommendations, and build universal content for easy personalization enhancements to any email or campaign.


Enabling the Integration

  1. Log in to your Rebuy account.

  2. Navigate to the "Integrations" tab in the left-hand side navigation.

  3. Find Klaviyo in the list of available integrations.

  4. Enable the integration.

  1. In Rebuy, go to the "Klaviyo Events" tab in the left-hand side navigation.

  2. Create a new event or edit an existing event.

  3. Specify the Data Source to be used.

  4. Toggle on "Send to Customer Profile" and define the name to be sent to the profile; "rebuy_recommendations" will be the default.

Step 3: Create a Product Feed Fallback

After creating the Klaviyo Event, you'll want to first create a Product Feed Fallback in your desired email campaign. It's important to clarify that although event variables can only typically be used in metric-triggered flow messages, Rebuy's "Send to customer profile" toggle in the Event Settings section allows Rebuy-powered recommendations to be surfaced in email campaigns.

Since some customers in an email campaign might not have past orders to trigger product recommendations from (i.e. the selected Customer Segment includes customers who don't have "Order Placed" events on their profiles), we recommend creating a Product Feed Fallback to ensure that recommendations are always surfaced.

Follow the steps below to create a Product Feed Fallback:

  1. Navigate to your Klaviyo portal to create a new email campaign or edit an existing one.

  2. Add a new section for the product feed with a text block(s) and insert the following conditional logic:

    1. {% if not person|lookup:'rebuy_property_name' %}

  3. Add a Klaviyo product feed block below the text block. If you don't have a feed created, check out this help article.

  4. Add another, second text block below the product block with the following end logic:

    1. {% endif %}

Step 4: Create a New Section for Rebuy Recommendations

  1. Add in a new section below the product feed section.

  2. Add a text block to the new section.

  3. Insert the following source code into the text block.

    1. Be sure to update the ' rebuy_recommendations ' portion of the code to mirror the "Recommendation Name" you input in the Event Settings section of the Klaviyo Event in the Rebuy Admin:

      1. rebuy_recs=person|lookup:'rebuy_recommendations'|slice:":6" %}
    2. For example: If your Klaviyo Event's name is "rebuy_recommendations_1" then update the code to read as:

      1. rebuy_recs=person|lookup:'rebuy_recommendations_1'|slice:":6" %}
<div>{% with columns=4 rebuy_recs=person|lookup:'rebuy_recommendations'|slice:":6" %}
<style>
.rebuy_product_block_table {
margin: 0 auto;
width: 100%;
border-collapse: collapse;
padding: 5px;
}
.rebuy_product_block_text {
text-align: center;
padding: 3px;
}
.rebuy-product-image-cell {
height: calc(100% / 4);
text-align: center;
}
.rebuy-product-image {
max-height: 100px;
max-width: 150px;
border-radius: 5px;
}
.rebuy-product-title-cell {
height: 50px;
vertical-align: top;
text-align: center;
padding-top: 5px;
font-size: 16px;
}
.rebuy-product-price-cell {
height: 20px;
vertical-align: top;
text-align: center;
font-size: 14px;
color: #333;
}
.rebuy-button {
display: inline-block;
padding: 8px 16px;
font-size: 14px;
border-radius: 5px;
background-color: #1155cc;
font-family: "Helvetica";
text-decoration: none !important;
color: #FFFFFF !important;
margin: 5px 0;
}
@media (max-width: 768px) {
.rebuy_product_block_table {
display: block;
width: 100%;
}
.rebuy_product_block_cell {
width: 50%;
box-sizing: border-box;
float: left;
}
.rebuy_product_block_table th {
width: 100%;
}
.rebuy_product_block_table th img {
display: block;
margin: 0 auto;
}
.rebuy-product-image-cell {
height: calc(100% / 2);
}
.rebuy-product-image {
max-height: 80px;
max-width: 120px;
}
.rebuy-product-title-cell {
font-size: 14px;
}
.rebuy-product-price-cell,
.rebuy-button {
font-size: 14px;
}
}
</style>
<table class="rebuy_product_block_table">
<tbody>
<tr>{% for item in rebuy_recs %}
<td class="rebuy_product_block_cell">{% catalog item.id %}
<table class="rebuy_product_block_inner_table">
<tbody>
<tr>
<th class="rebuy-product-image-cell"><a href="{{ catalog_item.url }}"> <img class="rebuy-product-image" src="{{ catalog_item.featured_image.thumbnail.src }}" alt="{{ catalog_item.title }}"> </a></th>
</tr>
<tr>
<th class="rebuy-product-title-cell">{{ catalog_item.title }}</th>
</tr>
<tr>
<td class="rebuy-product-price-cell">
<p class="rebuy_product_block_text">{% if catalog_item.metadata|lookup:"$price" %} {% currency_format catalog_item.metadata|lookup:"$price"|floatformat:2 %} {% elif catalog_item.metadata|lookup:"price" %} {% currency_format catalog_item.metadata|lookup:"price"|floatformat:2 %} {% endif %}</p>
</td>
</tr>
<tr>
<td>
<p class="rebuy_product_block_text"><a href="{{ catalog_item.url }}" class="rebuy-button">Shop Now</a></p>
</td>
</tr>
</tbody>
</table>
{% endcatalog %}</td>
{% if forloop.counter|divisibleby:4 %}</tr>
<tr>{% endif %} {% endfor %}</tr>
</tbody>
</table>
</div>
<div>{% endwith %}</div>

You should end up with 2 separate sections: one for the conditional product feed and another for the Rebuy Recommendations.

Step 5: Save Sections as Universal Content

  1. Save each section as "Universal Content" so you can use them anywhere.

  2. Name the product feed (first) section "Rebuy Recommendation Fallback".

  3. Name the other (second) section "Rebuy Recommendations".

Step 6: Using Universal Content in Klaviyo Campaigns

  1. In any Klaviyo email or campaign, go to the content editor.

  2. Select the universal content you created ("Rebuy Recommendation Fallback" and "Rebuy Recommendations").

  3. Insert the universal content into your email campaign.


FAQs

  • How do I know if the integration is working?

    After enabling the integration and setting up blocks, you can preview the email in Klaviyo with a customer that has made a purchase since the Rebuy event was enabled. To find an example customer, take a look at the Rebuy metric report in the Klaviyo Admin.

  • Can I customize the appearance of the product recommendations?

    Yes, the provided source code includes CSS styles and HTML that you can modify to match your brand's look and feel.

  • What if a customer doesn't have Rebuy recommendations on their profile?

    The conditional logic ensures that if a customer doesn't have Rebuy recommendations, a fallback product feed will be displayed instead.

  • How do I update the recommendations?

    You can update the recommendations by changing the Data Source in Rebuy or by modifying the event settings in Klaviyo. Keep in mind this will only change the recommendations for customers who are placing new orders.

  • What are the key benefits of using universal content blocks?

    Universal content makes it easy to reuse the same content across multiple emails and campaigns, ensuring consistency and saving time on content creation. For more details, check out Klaviyo's help center.

  • What is a catalog lookup?

    Rebuy sends some personalized recommendations to each customer profiles as they make purchases in the form of product ID's. The above source code uses Klaviyo's "Catalog Lookup" functionality, to ensure that the recommendation details are up to date with fresh data from Shopify. You can learn more about the catalog lookup here.


By following these steps, you'll be able to effectively use Rebuy recommendations in your Klaviyo campaigns, enhancing your email marketing efforts and driving more sales. If you have any further questions, please refer to the FAQ section or contact support.

Did this answer your question?