Braze - Integration Guide

      Braze - Integration Guide


        Article Summary

        Products


        Reviews

        Loyalty

        Visual UGC
        Supported plans

        Free, Starter, Pro, Premium, Enterprise

        eCommerce Platform

        Shopify, Shopify Plus, Adobe Commerce (Magento), BigCommerce, WooCommerce, Volusion, Salesforce Commerce Cloud, Custom

        The integration between Yotpo and Braze enables you to dynamically pull and display star ratings, top reviews, and visual UGC on products within emails and other communication channels within Braze. You can additionally include customer-level loyalty data in emails and other communication methods to create a more personalized interaction and boost sales and loyalty.

        Before you begin

        Before you connect Yotpo to your Braze account, you’ll need the following:

        Do the following:

        1. Go to your store website.
        2. Open the product page.
        3. Right-click and select Inspect.
        4. Press Ctrl+F and search for ‘yotpo-main’ in the code. The data-product ID variable and its value appear in the Yotpo div:

        Integrating Yotpo and Braze

        To integrate Yotpo and Braze, do the following:

        1. Log into your Braze account.
        2. Go to Campaigns > Create Campaign
        3. Select the Campaign channel.
        4. Select your preferred template.
        5. Click Edit email body.

        Add the relevant Connected Content snippet according to what you want to display.

        Tip:
        • Replace ##YOTPO API KEY## with your Reviews app key
        • Replace ##YOTPO LOYALTY GUID## with your Loyalty & Referrals GUID
        • Replace ##YOTPO LOYALTY API KEY## with your Loyalty & Referrals API key

        Displaying star rating and review count

        To display the public average score and total number of reviews for a product that is included in the email, add the following snippet:

        {% connected_content https://api.yotpo.com/products/##YOTPO API KEY##/{{event_properties.${product_id}}}/bottomline :save result %}  
        {% if {{result.response.bottomline.average_score}} != 0 %}
        The average rating for this product is: 
        
                            {{result.response.bottomline.average_score}}/5, based on  
                            {{result.response.bottomline.total_reviews}} reviews.
        {% else %}                    
        {% endif %}

        Example:

        Displaying recent 5-star review

        To display a top (published) review for a specific product that is included in the email, add the following snippet:

        {% connected_content https://api.yotpo.com/v1/widget/##YOTPO API KEY##/products/{{event_properties.${product_id}}}/reviews.json?per_page=50&star=5&sort=votes_up :save result %}      
        {% if {{result.response.reviews[0].score}} == 5 %}
        Recent 5 Star Review for this product: 
        
                      {{result.response.reviews[0].content}}
        {% else %}              
        {% endif %}

        Example:

        Displaying visual UGC

        To retrieve images that were tagged and published in Yotpo and add them to your emails instead of the stock image or as an additional gallery, add the following snippet:

        {% connected_content https://api.yotpo.com/v1/widget/##YOTPO API KEY##/albums/product/{{event_properties.${product_id}}}?per_page=1 :save result %}
        {% if {{result.response.images[0].tagged_products[0].image_url}} != null %} The Visual content of the product: 
               
        <img src="{{result.response.images[0].tagged_products[0].image_url}}" border="0" width="200" height="200" alt="" />
        {% else %}              
                      Image return NULL
        {% endif %}
        

        Example:

        Displaying customer’s loyalty balance

        To display a customer’s loyalty balance in an email, add the following snippet:

        {% connected_content
             https://loyalty.yotpo.com/api/v2/customers?customer_email={{${email_address}}}
             :method get
             :headers {
               "x-guid": "##YOTPO LOYALTY GUID##",
               "x-api-key": "##YOTPO LOYALTY API KEY##"
          }
             :content_type application/json
             :save publication
        %}
        You have {{publication.points_balance}} points 
        
        Only  {{publication.vip_tier_upgrade_requirements.points_needed}} more points to become part of our VIP Tier!
        Please note:
        {{${email_address}}}is a dynamic parameter and will be pulled dynamically from Braze. For the integration to work, the email must be the email of the customer that is receiving the email.

        Example:

        FAQ

        What happens if I don’t have any 5-star reviews?

        If the endpoint response returns NULL for the product image or 5-star review, the connected content endpoint for retrieving a 5-star review will not display any content.

        What happens if I don’t have any images published for a product?

        If the endpoint response returns NULL for the product image, the connected content endpoint for retrieving an image will not display any content.

        Can I customize the look and feel, or pull other data fields from Yotpo?

        Yes! See this guide about Braze Connected Content to discover what other data points and customization options are available. You may need some assistance from a front-end developer to do so.

        Having issues with the integration?
        Contact our Yotpo support team.

        Was this article helpful?