> ## Documentation Index
> Fetch the complete documentation index at: https://dokumentation.websale.de/llms.txt
> Use this file to discover all available pages before exploring further.

# Trusted shops

> Integrate the Trusted Shops trust seal, buyer protection and customer reviews into the shop, using the WEBSALE tags for data transfer.

Trusted Shops certifies online shops and awards a trust seal. For your shop, this means three building blocks that you can use individually or together: the trust seal itself, buyer protection as a money-back guarantee, and customer reviews.

All three run via the **Trustbadge**, a JavaScript component from Trusted Shops. The visible part is the seal with the rating display, usually at the bottom right of the shop. The invisible part reads the order data from the page after an order and offers the buyer buyer protection.

WEBSALE contributes exactly one thing: the order data in a form that the Trustbadge can read. Everything else is Trusted Shops.

> [!WARNING]
>
> Trusted Shops has moved its platform to eTrusted, changing integration methods and documentation pages in the process. The scripts on this page are **examples** that show where WEBSALE tags need to be inserted. Always get the current code to integrate from Trusted Shops and then transfer the tags.

## Overview of the three building blocks

| Building block | What it does | Activation by WEBSALE |
| - | - | - |
| Trust seal as Trustbadge | shows the seal and reviews in the shop | not required |
| Buyer protection, standard model | free for the buyer, can be taken out after the order | required |
| Buyer protection Excellence | subject to a fee, selected on the payment methods page | required |
| Customer reviews | display shop and product reviews and pass them to Google | not required |

Buyer protection requires the trust seal, and reviews build on the Trustbadge. So work through the sections in this order.

Detailed information is available from Trusted Shops at [business.trustedshops.com/knowledge/integration](https://business.trustedshops.com/knowledge/integration) and in the help area at [help.etrusted.com](https://help.etrusted.com/hc/de/articles/23970823488530-Trustbadge-Dokumentation-f%C3%BCr-Online-H%C3%A4ndler).

## Integrating the Trustbadge

### Step 1: Obtain the Trustbadge code

After certification, you receive your Trusted Shops ID from Trusted Shops. From it, Trusted Shops generates the script block with your individual Trustbadge code.

> [!WARNING]
>
> The following code is an example. Do not copy it; have Trusted Shops generate your own code instead. The example ID does not work in any shop.

### Step 2: Integrate the Trustbadge code

Insert the script block on the desired shop templates immediately before the closing `body` tag.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<script type="text/javascript">
  (function () {
    var _tsid = 'INDIVIDUELLER TRUSTBADGE-CODE';
    _tsConfig = {
      'yOffset': '0',                 /* Abstand vom unteren Seitenrand */
      'variant': 'reviews',           /* text, default, small, reviews, custom, custom_reviews */
      'customElementId': '',          /* nur für die Varianten custom und custom_reviews */
      'trustcardDirection': '',       /* für custom: topRight, topLeft, bottomRight, bottomLeft */
      'customBadgeWidth': '',         /* für custom: 40 bis 90 Pixel */
      'customBadgeHeight': '',        /* für custom: 40 bis 90 Pixel */
      'disableResponsive': 'false',
      'disableTrustbadge': 'false',
      'trustCardTrigger': 'mouseenter' /* 'click', wenn die Trustcard erst beim Klick aufgehen soll */
    };
    var _ts = document.createElement('script');
    _ts.type = 'text/javascript';
    _ts.charset = 'utf-8';
    _ts.async = true;
    _ts.src = '//widgets.trustedshops.com/js/' + _tsid + '.js';
    var __ts = document.getElementsByTagName('script')[0];
    __ts.parentNode.insertBefore(_ts, __ts);
  })();
</script>
```

> [!NOTE]
>
> Also integrate the block on the order confirmation page `ws_confirm.htm`. Without it there, there is no buyer protection, because that is exactly where the Trustcard opens.

## Integrating buyer protection

After the order is completed, the Trustbadge opens a small window, the Trustcard. In it, the buyer is offered buyer protection. For this to work, the Trustbadge must be able to read the order data from the page.

![Ts Trustcard](https://mintcdn.com/websaleag-44ee7ea6/UyjGmXApgB40YKCW/images/ts_trustcard.png?fit=max\&auto=format\&n=UyjGmXApgB40YKCW\&q=85\&s=5becda0eb03e167ada3f0a53f9ce6019)

### Prerequisite

Buyer protection must be activated for your shop by WEBSALE AG. Contact your WEBSALE representative.

### Passing the order data

On the order confirmation page `ws_confirm.htm`, insert the `WS-TrustBadge` tag.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
~WS-TrustBadge~
```

The tag generates a hidden container with the order data. From this, the Trustbadge recognizes that the customer has completed the order and opens the Trustcard. The customer does not have to enter anything again.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<div id="trustedShopsCheckout" style="display: none;">
   <span id="tsCheckoutOrderNr">Auftragsnummer</span>
   <span id="tsCheckoutBuyerEmail">E-Mail-Adresse des Kunden</span>
   <span id="tsCheckoutOrderAmount">Gesamtsumme</span>
   <span id="tsCheckoutOrderCurrency">Währung</span>
   <span id="tsCheckoutOrderPaymentType">Name der Zahlungsart</span>

   <!-- je Warenkorbposition -->
   <span class="tsCheckoutProductItem">
      <span class="tsCheckoutProductUrl">Link zum Produkt</span>
      <span class="tsCheckoutProductName">Produktname</span>
      <span class="tsCheckoutProductSKU">Produktnummer</span>
   </span>
</div>
```

> [!WARNING]
>
> `WS-TrustBadge` works **exclusively** on the order confirmation page. On any other template it has no effect, without any error message. It also stays silent if no Trusted Shops ID is stored for the shop.

> [!NOTE]
>
> The container lists every basket item, including set sub-products. For a set sub-product, the shop inserts the link of the set parent product so that the customer does not land on a page in the review request that does not exist individually.

> [!NOTE]
>
> Trusted Shops supports further optional fields, for example for delivery date, product image, GTIN, MPN and brand. The shop does not pass these. If you need them, for example for Google product reviews, you must add them to the container in the template yourself.

Reference: WS-TrustBadge

## Integrating buyer protection Excellence

In addition to the standard model, which is free for the buyer, there is the fee-based buyer protection Excellence. The customer selects it on the payment and shipping methods page from a list of products graded by insured amount. The costs appear in the basket like shipping costs and are included in the order data.

![Trustedshops Excellence](https://mintcdn.com/websaleag-44ee7ea6/UyjGmXApgB40YKCW/images/trustedshops_excellence.jpg?fit=max\&auto=format\&n=UyjGmXApgB40YKCW\&q=85\&s=310c63a908387a87998d1822f43b1630)

### Prerequisite

Buyer protection Excellence must be activated by WEBSALE AG. In the process, the Trusted Shops access credentials that the shop needs for the status query are also stored.

### Step 1: Configure the buyer protection products

In the `shop.config`, create the `TrustedShopsAdvList` section. You receive the product IDs for `TSID-Txt` from Trusted Shops.

```ini theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<TrustedShopsAdvList>
   VATRate-Value        = 1
   <+Entry>
      TSID-Txt      = TS123456_500_30_EUR
      ERPID-Txt     = 82TS500
      ListName-Txt  = Käuferschutz bis 500 € (0,97 € inkl. 19% deutscher MwSt. / 0,82 € netto)
      OrderName-Txt = Käuferschutz bis 500 €
      Cost-Value    = 0.82
   </+Entry>
   <+Entry>
      TSID-Txt      = TS123456_1500_30_EUR
      ERPID-Txt     = 82TS1500
      ListName-Txt  = Käuferschutz bis 1.500 € (2,94 € inkl. 19% deutscher MwSt. / 2,47 € netto)
      OrderName-Txt = Käuferschutz bis 1.500 €
      Cost-Value    = 2.47
   </+Entry>
</TrustedShopsAdvList>
```

| Parameter | Meaning |
| - | - |
| `VATRate-Value` | **number** of the VAT rate from the shop's tax rate table, not the percentage value |
| `VATType` | optional; with `dynamic`, VAT is calculated dynamically instead of statically |
| `TSID-Txt` | product ID from Trusted Shops |
| `ERPID-Txt` | your own item number for transfer to the merchandise management system |
| `ListName-Txt` | text in the selection list that the customer sees |
| `OrderName-Txt` | text in the order data |
| `Cost-Value` | net price |

> [!WARNING]
>
> `VATRate-Value` is an index, not a tax rate. The value `1` means "the first tax rate stored in the shop configuration", not "1 percent". If the parameter is missing or outside the valid indexes, the shop silently uses index 1.

> [!WARNING]
>
> The Trusted Shops product ID contains the insured amount in its name, following the pattern `<Ihre ID>_<Versicherungssumme>_<Laufzeit>_<Währung>`. The shop reads this amount to preselect the matching entry: it takes the **first** entry in the list whose insured amount is at least the order value. So sort the entries in ascending order of insured amount. If the order is wrong, the shop suggests an unnecessarily expensive product to the customer.

Reference: TrustedShopsAdvList section

### Step 2: Offer the selection on the payment and shipping methods page

Add a checkbox, selection list and explanation to `ws_pay_deliv.htm`.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{ST-TrustedShopsAdv}

   ~WS-TrustedShopsAdvCheck~ Trusted Shops Käuferschutz

   ~WS-TrustedShopsAdvList~

   Der Trusted Shops Käuferschutz sichert Ihren Online-Kauf ab.
   Mit der Übermittlung und Speicherung meiner E-Mail-Adresse zur Abwicklung
   des Käuferschutzes durch Trusted Shops bin ich einverstanden.

{/ST-TrustedShopsAdv}
```

| Tag | What it generates |
| - | - |
| `ST-TrustedShopsAdv` | bracket, only applies if buyer protection Excellence is activated |
| `WS-TrustedShopsAdvCheck` | the checkbox, plus a hidden field that controls the evaluation of the form |
| `WS-TrustedShopsAdvList` | the selection list as a ready-made `select` element |
| `WS-TrustedShopsAdvID` | the configured Trusted Shops ID, in case you need it in the template |

> [!NOTE]
>
> The checkbox is only preselected if the customer had already chosen buyer protection in this order. When the page is first called up, it is empty. A word like "recommended" next to the checkbox does not change this; it is just text.

> [!NOTE]
>
> The selection list remains completely empty if buyer protection is not activated or not a single entry has been configured. In that case, no empty selection field appears, but nothing at all.

Reference: ST-TrustedShopsAdv · WS-TrustedShopsAdvCheck · WS-TrustedShopsAdvList · WS-TrustedShopsAdvID

### Step 3: Store the error message

If Trusted Shops cannot be reached, the shop deactivates buyer protection and displays this message.

```ini theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<NotifyMessages>
   ...
   TrustedShopsAdv = Der Trusted Shops Käuferschutz steht momentan leider nicht
                     zur Verfügung und wurde deaktiviert.
   ...
</NotifyMessages>
```

Reference: NotifyMessages section

## Displaying reviews

Reviews do not need to be activated by WEBSALE AG. However, you do need buyer protection with the Trustbadge, because the review request is linked to the purchase.

![Ts Kundenbewertung Erinnerung](https://mintcdn.com/websaleag-44ee7ea6/UyjGmXApgB40YKCW/images/ts_kundenbewertung_erinnerung.png?fit=max\&auto=format\&n=UyjGmXApgB40YKCW\&q=85\&s=55301368a7670d52b90a82cf9c760c91)

### Shop reviews

The Trustbadge displays shop reviews by itself as soon as you have selected the `reviews` or `custom_reviews` variant in the configuration. Nothing else needs to be done in the shop.

> [!WARNING]
>
> Trusted Shops no longer provides the "Rate Later Link" function. It allowed a buyer to be reminded to submit a review. The review email after an order comes from Trusted Shops and not from WEBSALE. Check the email templates stored there and remove any button or link to this function, because it technically leads nowhere.

### Product reviews

For products to be reviewed individually, the product numbers of all ordered products must be sent to Trusted Shops. `WS-TrustBadge` takes care of this on the order confirmation page. Trusted Shops then sends the customer an email asking for a review; the review itself takes place on the Trusted Shops website.

To display the reviews in the shop, integrate a widget from Trusted Shops. The following block shows where the WEBSALE tags need to be inserted.

![20180514 Ts Bewertungssterne Unterhalb Produkt 02](https://mintcdn.com/websaleag-44ee7ea6/-4O6W3x8MU7HVGrG/images/20180514_ts-bewertungssterne-unterhalb-produkt_02.png?fit=max\&auto=format\&n=-4O6W3x8MU7HVGrG\&q=85\&s=9860090a2658deec5a17479b0ef8c90a)

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<script type="text/javascript">
   _tsProductReviewsConfig = {
      tsid: 'IHRE TRUSTED SHOPS ID',

      {PR-DepVariations}
         {CAT-AdvData($DepVariations,99)}sku: ['~PR-ProdIndex~'{@PR-Data},{PR-DepVariationName1}'~PR-Number~'{/PR-DepVariationName1}{/@PR-Data}],{/CAT-AdvData($DepVariations,99)}
      {/PR-DepVariations}

      {!PR-DepVariations}
         sku: '~PR-ProdIndex~',
      {/!PR-DepVariations}

      variant: 'productreviews',
      borderColor: '#8bab55',
      introtext: 'Was unsere Kunden über uns sagen:'
   };

   var scripts = document.getElementsByTagName('SCRIPT'),
       me = scripts[scripts.length - 1];
   var _ts = document.createElement('SCRIPT');
   _ts.type = 'text/javascript';
   _ts.async = true;
   _ts.charset = 'utf-8';
   _ts.src = '//widgets.trustedshops.com/reviews/tsSticker/tsProductSticker.js';
   me.parentNode.insertBefore(_ts, me);
   _tsProductReviewsConfig.script = _ts;
</script>
```

> [!NOTE]
>
> A product without variants passes its product index as a single value. A variant product passes an array of the base product's index and the numbers of all variants, so that Trusted Shops assigns the variants' reviews to the base product.

> [!WARNING]
>
> The variant branch above assumes that the base product has its own product number. If it is missing, an empty entry and a superfluous comma appear at the beginning of the array. In this case, set the commas yourself, for example with a counter:
>
> ```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
> {CAT-AdvData($DepVariations,99)}~DC-Int1_set(0)~ sku: [{@PR-Data}~DC-Int1_inc~{!DC-Int1(1)},{/!DC-Int1(1)}{PR-DepVariationName1}'~PR-Number~'{/PR-DepVariationName1}{/@PR-Data}],{/CAT-AdvData($DepVariations,99)}
> ```
>
> The counter ensures that there is no comma before the first entry.

### Displaying review stars separately

If you only want to show the stars in a specific place, for example next to the product name, use the summary widget.

![20180511 Ts Produktbewertung](https://mintcdn.com/websaleag-44ee7ea6/-4O6W3x8MU7HVGrG/images/20180511_ts-produktbewertung.png?fit=max\&auto=format\&n=-4O6W3x8MU7HVGrG\&q=85\&s=3170b02babbbbcf4dece4b0a76e63bc8)

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<div id="star-rating" style="cursor:pointer"></div>

<script type="text/javascript" src="//widgets.trustedshops.com/reviews/tsSticker/tsProductStickerSummary.js"></script>

<script type="text/javascript">
   var summaryBadge = new productStickerSummary();
   summaryBadge.showSummary({
      'tsId': 'IHRE TRUSTED SHOPS ID',

      {PR-DepVariations}
         {CAT-AdvData($DepVariations,99)}sku: ['~PR-ProdIndex~'{@PR-Data},{PR-DepVariationName1}'~PR-Number~'{/PR-DepVariationName1}{/@PR-Data}],{/CAT-AdvData($DepVariations,99)}
      {/PR-DepVariations}

      {!PR-DepVariations}
         'sku': '~PR-ProdIndex~',
      {/!PR-DepVariations}

      'element': '#star-rating',
      'starColor': '#FFDC0F',
      'starSize': '14px',
      'fontSize': '12px',
      'showRating': true,
      'scrollToReviews': false
   });
</script>
```

> [!WARNING]
>
> A `script` tag with `src` must be closed before the next one begins. Nesting two script blocks inside each other means the inner block is never executed and the stars are silently missing.

### Product reviews on Google

Trusted Shops automatically transfers product reviews to Google via JavaScript. Nothing else needs to be done on your side once the product reviews are integrated.

### Shop reviews as microdata

Your shop's reviews can also be passed to search engines as microdata and appear there as rich snippets.

Guide: Microdata for search engines and rich snippets

## Related topics

* Guide: Microdata for search engines and rich snippets
* Guide: Order confirmation


## Related topics

- [External services and interfaces](https://dokumentation.websale.de/en/v8s/referenz/konfigurationen/shopkonfiguration-shop-config/externe-dienste-und-schnittstellen.md)
- [Materials: consent to data processing](https://dokumentation.websale.de/en/v8s/materialien/materialien-einwilligung-zur-datenverarbeitung.md)
- [Migration from Newsletter V2 to E-Marketing-Manager](https://dokumentation.websale.de/en/v8s/marketing-funktionen/migration-von-newsletter-v2-zu-e-marketing-manager.md)
- [Styles for modules and interfaces](https://dokumentation.websale.de/en/v8s/referenz/styles/module-und-schnittstellen.md)
- [Structured data and rich snippets](https://dokumentation.websale.de/en/v8s/seo/strukturierte-daten-rich-snippets.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.