Hello! How can we help?

Browse the Trustpilot Support Center to find info on Google Seller Ratings, Rich Snippets, TrustBoxes, Product reviews, plus how-to guides for editing your reviews and account settings

Structured Data Snippet for Automatic Feedback Service (AFS)

The Structured Data Snippet is a way for you to expand on how you use AFS and increase control over what you send in the review invitation to your customer. On its own, AFS is a great and easy-to-use product, and expanding it with the Structured Data Snippet is a way to add more functionality, without making the product considerably more complicated. Trustpilot will always prioritize the data from the Structured Data Snippet over any settings you have made on the Automatic Feedback Service settings page.

Note: The Structured Data Snippet should be included in the source code of the trigger email sent to Trustpilot and/or your customers.

What does the Structured Data Snippet look like?

<script type="application/json+trustpilot">
{
  "recipientEmail": "customer@email.com",
  "recipientName": "Name MacNameson",
  "referenceId": "1234abcd",
  "templateId": "xyz123abc",
  "locale": "en-GB",
  "senderEmail": "your@senderemail.com",
  "senderName": "Sender Name",
  "replyTo": "your@replytomail.com",
  "preferredSendTime": "2016-02-29T13:37:00",
  "tags": ["Tag1","Tag2"],
  "products": [
    {
      "productUrl": "http://www.mycompanystore.com/products/12345.htm",
      "imageUrl": "http://www.mycompanystore.com/products/images/12345.jpg",
      "name": "Metal Toy Car",
      "sku": "ABC-1234",
      "gtin": "01234567890",
      "mpn": "7TX1641",
      "brand": "Acme"
    }
  ]
}
</script>

At first, this might seem very daunting and complex, this is however a very common data format known as JavaScript Object Notation (JSON for short), and in the next few steps we will pick it apart and explain why it looks as it does.

How do I use the Structured Data Snippet?

First of all, it is important to understand that the big chunk of code doesn’t always have to look as it does above. In fact, you can pick and mix the fields you want to use and the rest of the settings will be chosen from your settings in the Business Portal.

The way to use the Structured Data Snippet is to include it in the source code of the trigger email sent to Trustpilot and/or your customers.

When the Structured Data Snippet is used, it is recommended to automate it through programming, as it could cause issues with duplicate invitations.

How to add...

Customer name and reference number

If you would like to see the reference number appear with the review, you can add a reference number (referenceId) to the code. Doing this means you can easily identify each customer transaction. To add a more personal touch to the invitation, a name can also be added to the invitation and for this, you should use the [Name] placeholder in templates. It’s possible to both pre-verify and add a name to invitations, and the code below demonstrates how to accomplish this:

<script type="application/json+trustpilot">
{
  "recipientName": "Name MacNameson",
  "recipientEmail": "customer@email.com",
  "referenceId": "1234abcd"
}
</script>

Customer email

Adding the customer email to the Structured Data Snippet will always take precedence over the email in the To: field. This can be used in cases where only notification emails are possible and BCC can’t be used to send an email to your trigger email.

<script type="application/json+trustpilot">
{
  "recipientName": "Name MacNameson",
  "referenceId": "1234abcd",
  "recipientEmail": "customer@email.com"
}
</script>

Landing page and localized language

Using this code will set the specific invitation to the locale of your choosing, which will specify which landing page the customer will be directed to, as well as the language marked on the service review invitation in the Invitation History.

Note: The locale should be ISO15897 compliant.

<script type="application/json+trustpilot">
{
  "recipientName": "Name MacNameson",
  "recipientEmail": "customer@email.com",
  "referenceId": "1234abcd",
  "locale": "en-GB"
}
</script>

Tagging

Review tagging can be automated by specifying the tags you want to apply to a review. These tags can be specified before the review is submitted by the customer. You may use as many tags as you like. Refer to the code below to get an idea of the Structured Data Snippet you may use.

Note: Tags must not contain any spaces, as this will cause the invitation to fail.

<script type="application/json+trustpilot">
{
  "recipientName": "Name MacNameson",
  "recipientEmail": "customer@email.com",
  "referenceId": "1234abcd",
  “tags”: [“London”,“Sales”]
}
</script>

Product reviews

To collect product reviews, simply set up the Structured Data Snippet to include the data from your purchased products. With this setup, you’ll enjoy collecting both service and product reviews with one single invitation. You can add product data to the Structured Data Snippet in two ways:

Please note, you may need help from a developer.

1. One option is to add all transaction and product data to the Structured Data Snippet. This includes a URL, an image of the product, the name of the product, the SKU, and more. Here is an example:

<script type="application/json+trustpilot">
{
  "recipientName": "Name MacNameson",
  "recipientEmail": "customer@email.com",
  "referenceId": "1234abcd",
  "products": [
    {
      "productUrl": "http://www.companystore.com/.../12345.htm",
      "imageUrl": "http://www.companystore.com/.../.../12345.jpg",
      "name": "Metal Toy Car",
      "sku": "ABC-1234",
      "gtin": "1234567890",
      "mpn": "7TX1641",
      "brand": "Acme"
    },
    {
      "productUrl": "http://www.companystore.com/.../4321.htm,
      "imageUrl":"http://www.companystore.com/.../.../4321.jpg",
      "name": "Metal Toy Car Garage",
      "sku": "CBA-4321"
      "gtin": "9876543210"
      "mpn": "5TX1649"
      "brand": "Acme"
    }
  ]
}
</script>

2. The second option is easier to set up because you don’t have to send all product data (as in option 1) every time a product is purchased from your store. Simply upload your product catalog to Trustpilot, and then you only need to add a simple SKU for each purchased product to the Structured Data Snippet. Our system will then use the SKU(s) to match the remaining product details. You can read more about the advantages of this option here:

<script type="application/json+trustpilot">
{ 
 "recipientName": "Name MacNameson", 
 "recipientEmail": "customer@email.com", 
 "referenceId": "1234abcd", 
 "productSkus": ["ABC-1234","ABC-4321"]  
}
</script>

Specific time for invitation delivery

If you want to specify a date and time for invitation delivery, you may use the following code snippet. Please note that all times are in UTC.

<script type="application/json+trustpilot">
{
  "recipientName": "Name MacNameson",
  "recipientEmail": "customer@email.com",
  "referenceId": "1234abcd",
  "preferredSendTime": "2016-02-29T13:37:00"
}
</script>

Templates

If you want to have dynamic templates based on the customer you are inviting to leave a review, you may specify the template ID in the Structured Data Snippet as shown in the code below.

<script type="application/json+trustpilot">
{
  "recipientName": "Name MacNameson",
  "recipientEmail": "customer@email.com",
  "referenceId": "1234abcd",
  "templateId": "xyz123abc"
}
</script>

HTML comments to encapsulate the Structured Data Snippet

Some eCommerce systems may not allow inclusion of the Structured Data Snippet in the source code of the trigger email sent to Trustpilot and/or your customers. A possible solution for this issue would be to encapsulate the Structured Data Snippet with HTML comments as demonstrated in the code example below.

<!-- <script type="application/json+trustpilot">
{
  "recipientName": "Name MacNameson",
  "recipientEmail": "customer@email.com",
  "referenceId": "1234abcd",
  "templateId": "xyz123abc"
}
</script> -->

Comments

0 comments

Please sign in to leave a comment.