Implement Trustpilot's JavaScript integration

This feature is included in the Free, Plus, Premium, Advanced, and Enterprise plans.

Automate the review collection process with our JavaScript integration. Add it to your site in order to trigger review invitations to your customers.

The JavaScript integration supports service reviews, product reviews, and locations. Add it to almost any custom website to make it easy to send out review invitations. You can also use JavaScript with Google Tag Manager.

This integration requires technical knowledge and developer skills to set up.

We have a variety of integrations for ecommerce platforms that are easy to install and don't require any technical knowledge. We recommend one of those instead of this script if you're making use of an ecommerce platform that supports out-of-the-box integrations.

Set up the JavaScript integration

To automate your review invitations:

  1. In Trustpilot Business, go to Integrations >Ecommerce > JavaScript Integration, then click the Copy code button. 
  2. In your website's HTML source code, paste the code snippet in the <head>element or use Google Tag Manager.
  3. Back in Trustpilot Business, click the Verify button to verify your domain to make sure you've added the code correctly.
  4. In the Complete your setup workflow, under Finish setting up the integration, select the invitations that you want to automate. Click the Copy code button, then paste the script onto your confirmation page. Make sure to map the relevant fields, and then you're finished!

Looking for inspiration? Download our technical documentation for some implementation examples.

When you add this script to your website's HTML source code:

  • Replace each data element with the appropriate values of your website and, if you collect product reviews, the product attributes too.
  • Make sure that you load the script in the <head> element of every page or use Google Tag Manager.


Related articles