Skip to content

Review popup

Show a review pop-up after purchase and/or ask for consent(Ask me later) before sending an invitation. Thank you page pop-up

1. Insert the sidebar script

Example:

<script>
    (function (n, r) {
        var e = document.createElement("script");
        e.async = !0, e.src = n + "/sidebar.js?id=" + r + "&c=" + c(10, r);
        var t = document.getElementsByTagName("script")[0];
        t.parentNode.insertBefore(e, t);

        function c(s, i) {
            var o = Date.now(), a = s * 6e4, _ = (Math.sin(i) || 0) * a;
            return Math.floor((o + _) / a)
        }
    })("https://dashboard.webwinkelkeur.nl", <webshop's ID>);
</script>

You can find preconfigured code in your Dashboard

For more information about the sidebar - Sidebar docs

2. Insert order data script

WebwinkelKeur sidebar searches for a script with id ="webwinkelkeur_order_completed". When the script element is detected, the sidebar will load the pop-up.

You have to dynamically retrieve the orderNumber, email, firstName and place them inside the script. Place the script on the order finish page (Thank you page).

Example:

<script type="application/json" id="webwinkelkeur_order_completed">
{
    "webshopId": 123, // required - can be found in WebwinkelKeur dashboard
    "orderNumber": "order123", // required
    "email": "customerEmail@example.com", // optional
    "firstName": "Customer", // optional
    "inviteDelay": 1 // optional - default value 5
}
</script>

The sidebar will detect the order data script and display the Thank you page review pop-up.

Review pop-up does not create an invitation email. You have to call the Add invitation endpoint for that (Step 4).

Steps 3 and 4 are handled in the backend of your shop system.

You should use this endpoint to determine if an invitation should be created or not - Add invitation.

Before creating an invitation, call this endpoint to check if a consent has been given for the orderNumber.

GET /2.0/order_permissions.json

Query parameters

They should be passed as query parameters to the URL. (ex.: ?id=1&code=abc)

id int (required)

The unique webshop ID.

code string (required)

Your personal API code.

orderNumber string (required)

The order to check

Example response

{
    "has_consent": true
}

4. Add invitation

When an order has reached the desired status (usually "shipped" or "completed") and you've checked that consent has been given for this order, the Add invitation endpoint should be called.

This will create n review invitation record in the WebwinkelKeur system and after the set delay has passed, the invitation email will be sent. If the user has placed a review in the review pop-up, a finish/edit invitation email will be sent, otherwise a normal review invitation email.