Sending Bestsellers in a Klaviyo e-mail flow

Using Featured Recommendations in Klaviyo e-mail flows

A simple way to send featured recommendations, for example the current bestsellers.

Implementation

  • Make sure you have the URL to the recommendations endpoint. Copy it.
    For example recommendation id = 1: `/recommendations/featured/{instancekey}/1`

  • Configure the Web Feed in Klaviyo

    • Go to your Klaviyo Settings > Other > Web Feeds (link).
    • Click Add Web Feed.
      • Configure the settings exactly as follows:
        • Feed Name: Tweakwise_Bestsellers
        • Feed URL: paste the previously saved URL.
        • Request method: GET
        • Content type: JSON
  • Add the Code Block to Your Email Template:

    {% for item in feeds.Tweakwise_Bestsellers.items %}
    <div style="display:inline-block; width:45%; margin:2%; text-align:center; vertical-align:top;">
      <!-- Product Image -->
      <a href="{{ item.url }}">
        <img src="{{ item.image }}" alt="{{ item.title }}" style="max-width:100%; height:auto;">
      </a>
      
      <!-- Product Details -->
      <h4 style="margin:10px 0 5px 0;">{{ item.title }}</h4>
      <p style="color:#111111; font-weight:bold;">€{{ item.price }}</p>
    </div>
    {% endfor %}

Modify the code sample to display the products in a nice way.


Did this page help you?