Implement Trustpilot's JavaScript integration

Available for:

  • Free
  • Lite
  • Pro
  • Enterprise
This feature is included in our Free Plan! Try it today!

Automate the review collection process with Trustpilot's 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, including those built on platforms like WIX or Squarespace, to make it easy to send out review invitations. You can also use JavaScript with Google Tag Manager.

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

Trustpilot has 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. Navigate to Trustpilot Business > Integrations > JavaScript Integration, then click the Copy code button. 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.