Shopify Cue Recipe: Automatically Ask Customers to Review a Purchased Product

Product reviews play a big role in boosting sales, but getting customers to leave them can be difficult without an easy way to ask. This Cue recipe prompts customers to review a product they recently purchased. If a customer prefers not to review that item, the Cue also gives them a way to track their order instead.

Installation

Copy this code snippet and paste it underneath your Re:amaze Shoutbox script or existing Cue script, above the <head> tag.

Data-driven Cues using Shopify's liquid markup will not work through Google Tag Manager. You must paste this code directly into your theme.liquid template.

If you haven't installed Re:amaze on your Shopify store yet, see this tutorial for the basic setup steps.

{% if shop.customer_accounts_enabled and customer.id and customer.orders.size > 0 %}

  {% if customer.last_order.line_items.size > 0 %}
    <script type="text/javascript">
      var _support = _support || { 'ui': {}, 'user': {} };
      _support.outbounds = _support.outbounds || [];
      _support.outbounds.push({
        id: "RequestReview",
        name: "Review Product",
        message: "Hey, it looks like you recently bought a product from us. How do you like it? Let us know with a review!",
        sound: true,
        user: {
          type: "team"
        },
        buttons: [
          {
            text: "Review {{ customer.last_order.line_items[0].product.title }}",
            url: "https://YOURSTORE.myshopify.com/{{ customer.last_order.line_items[0].product.url }}"
          },
          {
            text: "Track your item",
            url: "{{ customer.last_order.line_items[0].fulfillment.tracking_url }}"
          }
        ],
        rules: [
          {
            type: "timeOnSite",
            op: "greaterThan",
            value: "20s"
          }
        ]
      });
    </script>
  {% endif %}
{% endif %}

What this code does

  • {% if shop.customer_accounts_enabled and customer.id and customer.orders.size > 0 %} limits the Cue to customers who are logged in and have placed at least one order.
  • {% if customer.last_order.line_items.size > 0 %} limits the Cue to the customer's last order, and only triggers if that order contains at least one line item.
  • Review {{ customer.last_order.line_items[0].product.title }} Displays the name of the customer's last order's first line item name.
  • [https://YOURSTORE.myshopify.com/](https://YOURSTORE.myshopify.com/){{ customer.last_order.line_items[0].product.url }} links directly to that product's page so the customer can leave a review.
  • {{ customer.last_order.line_items[0].fulfillment.tracking_url }} links directly to that product's page so the customer can leave a review.

What you can customize:

  • The message text to something that you prefer
  • The button text to something that you prefer

What customers see

This Cue appears as a chat message with two buttons: one to review the purchased product, and one to track the order.

reviewrequest.png









This Cue appears as a chat message with two buttons: one to review the purchased product, and one to track the order.

Where to paste this code

Paste the code snippet into your theme.liquid file, directly beneath your existing Re:amaze Shoutbox or Cue script.

Alt Text

Not finding what you're looking for? Contact Us Directly