Integrating a trustpilot API into a shopify website

714 Views Asked by At

I'm a javascript developer and a potential client asked me if I could integrate the trustpilot API for product reviews into their shopify website. Would anybody have any tips on how this would be done? I'm assuming I would need access to their shopify site and could add the code for the API there? I've never worked with shopify before and I'm just trying to research how this would be done. Thanks for the help!

1

There are 1 best solutions below

0
On

Trustpilot have pretty straightforward javascript integration with Shopify. The steps are next:

  1. Install Trustpilot app into Shopify so they can fetch all your products list

  2. Add Trustpilot javascript widget to specific page do you want them to appear

     <script type="text/javascript" src="//widget.trustpilot.com/bootstrap/v5/tp.widget.bootstrap.min.js" async></script>
    
     <div class="trustpilot-widget" data-locale="en-US" data-stars="1,2,3,4,5" data-reviewnumber="5" data-template-id="111" data-businessunit-id="xxx" data-style-height="700px" data-style-width="100%" data-theme="light" data-sku="xxx" data-review-languages="en">
         <a href="https://www.trustpilot.com" target="_blank" rel="noopener">Trustpilot</a>
     </div>
     <!-- End TrustBox widget -->
    
  3. Start collecting reviews via TrustPilot app

Docs: https://support.trustpilot.com/hc/en-us/articles/203840826-Add-a-TrustBox-to-a-webpage

Please note that data-businessunit-id and data-template-id will be defined in your trustpilot app