> ## 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.

# E-Search_ (campaigns)

> Display FACT-Finder campaigns in the shop: advisor campaigns with questions and answers, feedback campaigns with texts and products, redirect campaigns.

> [!WARNING]
>
> The FACT-Finder direct integration is deprecated and no longer supported. It is only available up to FactFinder version 6.9 and is neither maintained nor developed further by WEBSALE. New integrations run exclusively via the FactFinder WebComponents. This reference serves the operation of existing shops.

A campaign is a rule in the FACT-Finder Management that delivers something additional for certain search terms. There are three types, and each needs its own block in the template.

| Type | Delivers |
| - | - |
| Advisor campaign | questions with predefined answers that narrow down the search step by step |
| Feedback campaign | texts and a selection of products |
| Redirect campaign | a target address to redirect to |

Campaigns get their own template, stored in the shop configuration `shop.config` in the `ExternalSearch` section under the `FACTFinderCampaignTemplate` parameter. This allows them to be included on the product detail and basket pages via `WS-ExternInclude`.

Guide: Integrating FACT-Finder campaigns · Guide: FACT-Finder at a glance · Reference: E-Search\_ (basics and result list)

## The basic structure

`E-Search_Campaign` is both the check for existing campaigns and the loop over them. Within the loop, three ranges determine which type it is.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{!E-Search_Campaign}
   <!-- keine Kampagne für diese Suche, nichts anzeigen -->
{/!E-Search_Campaign}

{E-Search_Campaign}
   {@E-Search_Campaign}
      {E-Search_CampaignType_Advisor}
         <!-- Berater-Kampagne -->
      {/E-Search_CampaignType_Advisor}

      {E-Search_CampaignType_Feedback}
         <!-- Feedback-Kampagne -->
      {/E-Search_CampaignType_Feedback}

      {E-Search_CampaignType_Target}
         <!-- Weiterleitungs-Kampagne -->
      {/E-Search_CampaignType_Target}
   {/@E-Search_Campaign}
{/E-Search_Campaign}
```

> [!NOTE]
>
> A search can trigger several campaigns at the same time, including of different types. That is why the type check is inside the loop and not before it.

### Distinguishing campaigns

| Tag | Returns |
| - | - |
| `E-Search_Campaign_Name()` | the name of the campaign |
| `E-Search_Campaign_Id()` | the ID of the campaign |
| `E-Search_Campaign_Category()` | the category the campaign belongs to |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{@E-Search_Campaign}
   {E-Search_Campaign_Category(Fruehling2026)}
      <div class="kampagne fruehling">
         <!-- eigene Gestaltung für alle Kampagnen dieser Kategorie -->
      </div>
   {/E-Search_Campaign_Category(Fruehling2026)}
{/@E-Search_Campaign}
```

> [!WARNING]
>
> The category of a campaign has nothing to do with the shop's categories. It is merely a grouping in the FACT-Finder Management that lets you address several campaigns together.

> [!NOTE]
>
> For permanent special displays, the ID from `E-Search_Campaign_Id()` is the most reliable choice. Names and categories are more easily renamed in the Management, and a renamed name silently makes the range come to nothing.

## Advisor campaigns

An advisor campaign consists of questions, and each question has answers. In the template, two loops are therefore nested inside each other.

| Tag | Returns |
| - | - |
| `E-Search_CampaignAdvisor` | the loop over the questions; as a single tag, the question text |
| `E-Search_CampaignAdvisorEncoded` | the same text HTML-encoded |
| `E-Search_CampaignAdvisor_Id()` | the ID of the current question |
| `E-Search_CampaignAdvisorItem` | the loop over the answers; as a single tag, the answer text |
| `E-Search_CampaignAdvisorItemEncoded` | the same text HTML-encoded |
| `E-Search_CampaignAdvisorItem_Id()` | the ID of the current answer |
| `E-Search_CampaignAdvisorItem_Link` | the link that selects this answer |
| `E-Search_CampaignAdvisorItem_Params` | only the link parameters for an SEO address |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{@E-Search_Campaign}
   {E-Search_CampaignType_Advisor}
      <section class="berater">
         {@E-Search_CampaignAdvisor}
            <h3>~E-Search_CampaignAdvisorEncoded~</h3>
            <ul>
               {@E-Search_CampaignAdvisorItem}
                  <li>
                     <a href="~E-Search_CampaignAdvisorItem_Link~">
                        ~E-Search_CampaignAdvisorItemEncoded~
                     </a>
                  </li>
               {/@E-Search_CampaignAdvisorItem}
            </ul>
         {/@E-Search_CampaignAdvisor}
      </section>
   {/E-Search_CampaignType_Advisor}
{/@E-Search_Campaign}
```

> [!WARNING]
>
> Questions and answers come from the FACT-Finder Management, i.e. from a source outside the shop. Therefore, use the `Encoded` variants unless you have deliberately stored HTML there. The unencoded variants output everything unchanged, including characters that break the page structure.

> [!NOTE]
>
> You need the IDs from `_Id()` if a particular question or answer should look different from the others, for example with an image instead of text.

## Feedback campaigns

A feedback campaign returns texts plus a product selection. Both are separate loops.

### The texts

| Tag | Returns |
| - | - |
| `E-Search_CampaignFeedbackText` | the check and the loop over the texts; as a single tag, the text |
| `E-Search_CampaignFeedbackText_Label()` | the heading for the current text |
| `E-Search_CampaignFeedbackText_Id()` | the ID of the current text |
| `E-Search_CampaignFeedbackText_HTML` | applies if the text is delivered as HTML |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{@E-Search_Campaign}
   {E-Search_CampaignType_Feedback}
      {E-Search_CampaignFeedbackText}
         {@E-Search_CampaignFeedbackText}
            <section class="kampagnentext">
               <h3>~E-Search_CampaignFeedbackText_Label~</h3>

               {E-Search_CampaignFeedbackText_HTML}
                  ~E-Search_CampaignFeedbackText~
               {/E-Search_CampaignFeedbackText_HTML}

               {!E-Search_CampaignFeedbackText_HTML}
                  <p>~E-Search_CampaignFeedbackText~</p>
               {/!E-Search_CampaignFeedbackText_HTML}
            </section>
         {/@E-Search_CampaignFeedbackText}
      {/E-Search_CampaignFeedbackText}
   {/E-Search_CampaignType_Feedback}
{/@E-Search_Campaign}
```

> [!NOTE]
>
> `E-Search_CampaignFeedbackText_HTML` tells you whether the stored text already contains markup. Plain text needs a paragraph around it in the template; HTML text brings its own structure and would end up incorrectly nested inside a paragraph.

> [!WARNING]
>
> A label can be empty. Enclose the heading with `{E-Search_CampaignFeedbackText_Label}` if you want to avoid empty headings.

### The products

| Tag | Returns |
| - | - |
| `E-Search_CampaignFeedbackResult` | the loop over the campaign's products |
| `E-Search_CampaignFeedbackResult_Index` | the product index of the current entry |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{@E-Search_Campaign}
   {E-Search_CampaignType_Feedback}
      <ul class="kampagnenprodukte">
         {@E-Search_CampaignFeedbackResult}
            {PR-AdvData($E-Search_CampaignFeedbackResult_Index$)}
               <li>
                  <a href="~PR-Link~">~PR-Name~</a>
                  ~PR-Price~
               </li>
            {/PR-AdvData($E-Search_CampaignFeedbackResult_Index$)}
         {/@E-Search_CampaignFeedbackResult}
      </ul>
   {/E-Search_CampaignType_Feedback}
{/@E-Search_Campaign}
```

> [!NOTE]
>
> As with the result list, FACT-Finder only returns product indexes. `PR-AdvData()` fetches the actual product data from the shop so that prices and availability are correct.

> [!NOTE]
>
> The loop accepts two parameters: the first entry to display and the number of entries. `{@E-Search_CampaignFeedbackResult(1,4)}` shows the first four products, which is usually enough for a teaser next to the hit list.

## Redirect campaigns

A redirect campaign returns a target address to which the visitor should be sent.

| Tag | Returns |
| - | - |
| `E-Search_CampaignTarget` | the target address |
| `E-Search_CampaignTarget_Name()` | the name of the campaign |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{@E-Search_Campaign}
   {E-Search_CampaignType_Target}
      <p>
         Passend zu Ihrer Suche:
         <a href="~E-Search_CampaignTarget~">~E-Search_CampaignTarget_Name~</a>
      </p>
   {/E-Search_CampaignType_Target}
{/@E-Search_Campaign}
```

> [!WARNING]
>
> At this point, the old documentation shows an immediate redirect via JavaScript. An unannounced redirect takes control away from the visitor and makes the back button useless, because the search results page immediately redirects again. A clearly visible link is the better choice in almost all cases.

> [!NOTE]
>
> If you still want to redirect, a visible notice about it belongs on the page, together with a link to the unfiltered hit list.

## Links for SEO addresses

As everywhere, there is a Params variant for the answers of an advisor campaign.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{@E-Search_CampaignAdvisorItem}
   ~DC-FPFactFinderLink_reset~
   ~DC-FPFactFinderLink_set($CAT-Link$)~

   {E-Search_CampaignAdvisorItem_Params}
      {DC-FPFactFinderLink_contains(?)}
         ~DC-FPFactFinderLink_append(&)~
      {/DC-FPFactFinderLink_contains(?)}
      {!DC-FPFactFinderLink_contains(?)}
         ~DC-FPFactFinderLink_append(?)~
      {/!DC-FPFactFinderLink_contains(?)}
   {/E-Search_CampaignAdvisorItem_Params}

   ~WS-DisableXSSProtectionOnce~
   <a href="~DC-FPFactFinderLink~~E-Search_CampaignAdvisorItem_Params~">
      ~E-Search_CampaignAdvisorItemEncoded~
   </a>
{/@E-Search_CampaignAdvisorItem}
```

Guide: SEO extension of links · Reference: DC- (Parameters)

## The tags at a glance

| Tag | Single tag | Range tag | Negative range tag | Loop tag |
| - | - | - | - | - |
| `E-Search_Campaign` | – | yes | yes | yes |
| `E-Search_Campaign_Name()` | yes | yes | yes | – |
| `E-Search_Campaign_Id()` | yes | yes | yes | – |
| `E-Search_Campaign_Category()` | yes | yes | yes | – |
| `E-Search_CampaignType_Advisor` | – | yes | yes | – |
| `E-Search_CampaignType_Feedback` | – | yes | yes | – |
| `E-Search_CampaignType_Target` | – | yes | yes | – |
| `E-Search_CampaignAdvisor` | yes | – | – | yes |
| `E-Search_CampaignAdvisorEncoded` | yes | – | – | – |
| `E-Search_CampaignAdvisor_Id()` | yes | yes | yes | – |
| `E-Search_CampaignAdvisorItem` | yes | – | – | yes |
| `E-Search_CampaignAdvisorItemEncoded` | yes | – | – | – |
| `E-Search_CampaignAdvisorItem_Id()` | yes | yes | yes | – |
| `E-Search_CampaignAdvisorItem_Link` | yes | yes | yes | – |
| `E-Search_CampaignAdvisorItem_Params` | yes | yes | yes | – |
| `E-Search_CampaignFeedbackText` | yes | yes | yes | yes |
| `E-Search_CampaignFeedbackText_Label()` | yes | yes | yes | – |
| `E-Search_CampaignFeedbackText_Id()` | yes | yes | yes | – |
| `E-Search_CampaignFeedbackText_HTML` | – | yes | yes | – |
| `E-Search_CampaignFeedbackResult` | – | – | – | yes |
| `E-Search_CampaignFeedbackResult_Index` | yes | yes | yes | – |
| `E-Search_CampaignTarget` | yes | – | – | – |
| `E-Search_CampaignTarget_Name()` | yes | yes | yes | – |

All tags on this page apply in the campaign template and in the search template. The Advisor tags only within `E-Search_CampaignType_Advisor`, the Feedback tags only within `E-Search_CampaignType_Feedback`, and the Target tags only within `E-Search_CampaignType_Target`.

> [!NOTE]
>
> `E-Search_CampaignResult()` and `E-Search_CampaignResultIndex` still appear in the old documentation. They have been replaced by `E-Search_CampaignFeedbackResult` and `E-Search_CampaignFeedbackResult_Index` and are therefore not listed here.

## Related topics

* Guide: Integrating FACT-Finder campaigns
* Guide: FACT-Finder at a glance
* Reference: E-Search\_ (basics and result list)
* Reference: E-Search\_ (filters)


## Related topics

- [E-Search_ (basics and result list)](https://dokumentation.websale.de/en/v8s/referenz/tags/e-search/grundlagen-und-ergebnisliste.md)
- [E-Search_ (filters)](https://dokumentation.websale.de/en/v8s/referenz/tags/e-search/filter.md)
- [E-Search_ (sorting)](https://dokumentation.websale.de/en/v8s/referenz/tags/e-search/sortierung.md)
- [E-Search_ (pagination and hits per page)](https://dokumentation.websale.de/en/v8s/referenz/tags/e-search/blaettern-und-treffer-pro-seite.md)
- [FACT-Finder campaigns](https://dokumentation.websale.de/en/v8s/integration-von-fact-finder/fact-finder-kampagnen.md)


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