Adding Star Ratings to Klaviyo emails
Updated this week

Available on the Awesome plan

With Judge.me x Klaviyo integration, you can now add Star Ratings to your Klaviyo emails.

Step 1: Create Klaviyo API key

  • From your Klaviyo admin, go to Settings > API Keys.

  • Click Create Private API Key and name your key "Judge.me".

  • Select Grant applications full access for every API scope.

  • Click Create.

Step 2: Enable review information feed

  • From Judge.me admin, go to General Settings > Integrations > Admin Backend > Email Marketing Integration.

  • Select Klaviyo.

  • Paste in the API key you created in Step 1 and click Check.

  • Once the API key is added, enable Review Information Feed and click Save.


For other platforms

  • From your Judge.me admin, go to Settings > Integrations > Admin Backend > Email Marketing Integration.

  • Select Klaviyo.

  • Paste in the API key you created in Step 1 and click Check.

  • Once the API key is added, enable Review Information Feed and click Save.


Step 3: Add the feed to Klaviyo

  • From your Klaviyo admin, go to Settings > Other > Web feeds.

  • Click Add web feed and fill in the feed details:

Feed Name

JudgemeReviewInfoFeed

Feed URL

Paste in the feed URL from Step 2

Request Method

GET

Content Type

JSON

  • Click Add Data Feed.

Step 4: Use the feed in Klaviyo emails

  • From your Klaviyo admin, go to Flows and select the flow you want.

  • Click the Email block on your flow and click Edit.

  • Then click Edit email.

  • In the Text block where the product title is, click the </> icon and paste in the code below:

<div>
{% with productIdKlaviyo=item.product.id|slugify %}
{% for product in feeds.JudgemeReviewInfoFeed.products %}
{% with productIdJdgm=product.product_id|slugify %}
{% if productIdJdgm == productIdKlaviyo %}
<span style="font-size: 18px; color: #399999; letter-spacing: 2px; margin-bottom: 12px; display: inline-block;">
{% if product.average_rating >= 4.5 and product.average_rating <= 5 %} ★★★★★
{% elif product.average_rating >= 3.5 and product.average_rating < 4.5 %} ★★★★☆
{% elif product.average_rating >= 2.5 and product.average_rating < 3.5 %} ★★★☆☆
{% elif product.average_rating >= 1.5 and product.average_rating < 2.5 %} ★★☆☆☆
{% elif product.average_rating >= 1 and product.average_rating < 1.5 %} ★☆☆☆☆
{% endif %}
</span>
<span>
{{ product.review_count }}
{% if product.review_count == 1 %}
review
{% else %}
reviews
{% endif %}
</span>
{% endif %}
{% endwith %}
{% endfor %}
{% endwith %}
</div>

  • Depending on the email template you use, you might need to change the item.product.id variable in the code block.

  • Click the </> icon again to apply the changes.

  • Click Preview and Test to preview your email with a real product.

  • Once done, save your email and activate the flow.

Here's how your email might look:

If you want to change the star color, you can change the style attribute of the <span> element that contains the stars.

<span style="font-size: 18px; color: #399999; letter-spacing: 2px; margin-bottom: 12px; display: inline-block;">

If you need help adding Star Ratings to Klaviyo emails, contact our team at [email protected]. We're available to help 24/7!

Did this answer your question?