Trustpilot is an online review community created for online businesses. Setting up Trustpilot on your store allows you to collect product and service reviews from customers via email after they complete their purchases. In this article, we will walk you through the process of integrating Trustpilot into your store.
In this article
A. Display Trustpilot widget in your store
B. Set up Trustpilot review email invitations
A. Display Trustpilot widget in your store



The widget types will depend on your Trustpilot plan. You can upgrade your Trustpilot plan to have more types. Please visit the article TrustBox widget overview for more information.

B. Set up Trustpilot review email invitations

If you use Theme Editor, go to Online store > Preferences, paste the copied code from Trustpilot to Head section.

window.sbsdk.ready(function(){
window.sbsdk.checkout.onCompleteOrder(function(payload) {
const order = window.sbsdk.checkout.getOrder();
let productSkus = [];
let products = [];
for (let item of order.items) {
productSkus.push(item.product_sku);
}
for (let item of order.items) {
const url = window.location.host + '/products/' + item.product_title.trim().replaceAll(' ', '-');
products.push({
sku: item.product_sku,
name: item.product_title,
imageUrl: item.image,
productUrl: url
});
}
const trustpilot_invitation = {
recipientEmail: order.email,
recipientName: window.sbsdk.checkout.getOrder().shipping_address.first_name,
referenceId: 'Order ' + order.name,
source: 'InvitationScript',
productSkus: productSkus,
products: products,
};
tp('createInvitation', trustpilot_invitation);
})
})

After completing all the steps in section B to integrate Trustpilot with your store, you can test the results to see if everything is working properly by following the steps below:

After you've verified the integration's results, you can adjust this setting back to your preference.

Now it is ready to automatically send customers a review invitation after a purchase from your store.
Additional scripts added to the store will NOT load on the checkout page for security reasons and to prevent payment interference. Use ShopBase’s built-in tracking and integrations instead.