hello@newnorth.nl+31 (0) 85 401 31 62
/Journal

Trustpilot GTM tag template

TemplateGTM2026.04.03
Freek Kampen
Freek KampenCo-founder, New North Digital

Loads TrustBox review widgets and sends post-purchase review invitations, both from a single Google Tag Manager template.

What it does

The Trustpilot template for Google Tag Manager supports two actions: loading TrustBox review widgets on your pages, and sending post-purchase review invitation emails.

The widget loader injects the Trustpilot bootstrap script, which finds and renders every TrustBox element on the page. The invitation action uses Trustpilot's official tp() command queue.

Features

  • Two action types in a single template: widget loading and review invitations
  • The TrustBox loader auto-discovers all trustpilot-widget elements on the page
  • Invitations support customer name, email, order ID and product SKUs
  • Uses Trustpilot's tp() command queue for reliable delivery
  • Product SKU support for product-level review collection
  • Widget rendering needs no configuration beyond placing the TrustBox HTML

Loading TrustBox widgets

The widget action injects the bootstrap script from https://widget.trustpilot.com/bootstrap/v5/tp.widget.bootstrap.min.js. That script scans the page for elements with the trustpilot-widget class and renders the matching TrustBox inside each one.

  • Create a new tag using the Trustpilot template.
  • Set Action Type to Load TrustBox widgets. No other fields need configuring.
  • Add TrustBox HTML snippets where you want widgets to appear. Get them from your Trustpilot dashboard under Integrations, then TrustBox library.
<div class="trustpilot-widget"
     data-locale="en-US"
     data-template-id="5419b6a8b0d04a076446a9ad"
     data-businessunit-id="YOUR_BUSINESS_UNIT_ID"
     data-style-height="24px"
     data-style-width="100%">
  <a href="https://www.trustpilot.com/review/example.com" target="_blank">Trustpilot</a>
</div>

Sending review invitations

Under the hood the template runs:

tp('register', yourIntegrationKey);
tp('createInvitation', {
  recipientEmail: email,
  recipientName: name,
  referenceId: orderId,
  source: 'InvitationScript',
  productSkus: skuArray
});
  • Create a new tag using the Trustpilot template.
  • Set Action Type to Send review invitation.
  • Enter your Integration Key, found under Integrations, then Invitation script setup.
  • Map Customer Email, Customer Name and Order ID to Data Layer variables from your order confirmation page.
  • Optionally add Product SKUs as a comma-separated string, for example SKU-001,SKU-002,SKU-003.

Triggers and setup

For widgets. Use a Page View trigger on every page that contains TrustBox HTML. If a widget sits in the footer on all pages, All Pages works. Otherwise add a URL path condition.

For invitations. Use an Event trigger on your purchase or order confirmation event, either a Custom Event trigger matching your dataLayer event or a Page View trigger restricted to the confirmation URL.

dataLayer.push({
  event: 'purchase',
  customerEmail: 'customer@example.com',
  customerName: 'John Doe',
  orderId: 'ORD-12345',
  productSkus: 'SKU-001,SKU-002'
});

Consent. TrustBox widgets load external scripts and may set cookies, and the invitation action transmits personal data. Configure both tag types to respect your consent setup.

Troubleshooting

Widgets do not render. Check the TrustBox elements exist in the DOM with the trustpilot-widget class, that data-businessunit-id matches your business unit, and that the tag actually fires in Preview mode. Look for console errors from the bootstrap script.

Invitation fires but no email arrives. Confirm the Integration Key is correct and active, that Customer Email holds a valid address when the tag fires, and that Order ID is unique, since Trustpilot deduplicates on reference ID. Allow up to 24 hours for delivery.

Product reviews not collected. Pass Product SKUs as a comma-separated string, not an array, and check the SKUs exist in your Trustpilot product catalog.

Widget shows the wrong content. Check data-template-id, since every widget style has its own ID in the TrustBox library, and that data-locale matches your site language.

Support

  • TrustBox integration guide: https://support.trustpilot.com/hc/en-us/articles/115011421468
  • Trustpilot business dashboard: https://businessapp.b2b.trustpilot.com/
  • Invitation script documentation: https://support.trustpilot.com/hc/en-us/categories/115000626108

Want to talk about this?

Let's talk data.

Tell us about your stack, your goals, the data you wish you had.

Takes 1 minute