For the complete documentation index, see llms.txt. This page is also available as Markdown.

Campaign

Render feedback, advisor, and redirect campaigns with FactFinder Web Components.

Documentation

Adding Feedback campaigns

Feedback campaigns can be displayed using ff-campaign-feedbacktext elements. You may add multiple elements, and they can be placed anywhere in the document.

Through the label attribute, you define which campaigns can be displayed by the element. The attribute's value must match one of the campaigns' labels that are defined in FactFinder.

If multiple campaigns are configured to target the same label, the ff-campaign-feedbacktext element with the corresponding label will serve as the outlet to all these campaigns.

Remember that a campaign's trigger condition must still be satisfied before it can be displayed by ff-campaign-feedbacktext. If multiple campaigns with the same label are triggered simultaneously, the campaign appearing last in the FactFinder response will be displayed.

The only necessary data binding is {{text}}.

If you are using HTML feedback texts, you need to use the {{{triple curly brace syntax}}}.

<ff-campaign-feedbacktext label="above products">
    {{text}}
    <!--or mixed content-->
    <!--<div>{{text}}</div>-->
</ff-campaign-feedbacktext>

Display results from stand-alone campaign triggers

By default, ff-campaign-feedbacktext only displays campaigns that are part of a search result. However, there is the option to trigger campaigns independent of searches. These are landing page, product and shopping cart campaigns.

In order to display these kind of campaigns, you have to add a corresponding attribute. The element will then only respond to the specified trigger and no longer react to search results.

Campaign triggers
Attribute
Triggered by element

is-landing-page-campaign

ff-campaign-landing-page

is-product-campaign

ff-campaign-product

is-shopping-cart-campaign

ff-campaign-shopping-cart

Note that only one attribute at a time is allowed.

Adding Advisor campaigns

To integrate advisor campaigns, you need the following elements:

  • ff-campaign-advisor

  • ff-campaign-advisor-question

  • ff-campaign-advisor-answer

Whenever there is an active advisor campaign in the search result, the ff-campaign-advisor element will display it.

ff-campaign-advisor

ff-campaign-advisor is the outer element that contains ff-campaign-advisor-question and ff-campaign-advisor-answer. It offers two optional attributes, name and not, to limit which campaigns the element shall display.

With name, you can restrict the element to display one particular advisor campaign. The value matches a campaign name configured in FactFinder UI.

The not attribute takes a comma-separated list of campaign names that shall be ignored.

When both name and not are set, only the name attribute will be considered. not will be ignored.

ff-campaign-advisor-question

ff-campaign-advisor-question is used as a template for each question configured in FactFinder. It is rendered at the position you define it in the HTML.

To enable data binding to the underlying question object from the FactFinder response, you must place a data-question attribute (without a value) on a child element of ff-campaign-advisor-question.

If the text of your question contains HTML, use triple curly braces. Double curly braces render the contained text verbatim without interpreting it as HTML.

ff-campaign-advisor-answer

ff-campaign-advisor-answer is used as a template for each answer in the applied advisor campaign. It must be nested inside ff-campaign-advisor-question, where it is rendered at the position it is defined in the HTML.

Unlike ff-campaign-advisor-question, it does not require further attributes and data binding to the underlying answer object is available inside the entire ff-campaign-advisor-answer element.

Again, use triple curly braces for data binding if your answer text contains HTML.

Adding Redirect campaigns

ff-campaign-redirect redirects the browser to a redirect campaign's destination. When the latest FactFinder request triggers a redirect campaign, response processing stops and the redirect happens immediately.

Place the element directly after the opening <body> tag. This ensures it runs before other elements.

Internally, the element uses document.location.replace.

relative-to-origin

relative-to-origin is optional and takes no value. When present, a relative destination without a leading slash resolves against the current page's origin. Absolute URLs and paths beginning with / are unaffected.

For a current URL of https://www.your.shop/section/sub-section:

URL resolution

Campaign destination

With relative-to-origin

Without relative-to-origin

relative/page

https://www.your.shop/relative/page

https://www.your.shop/section/relative/page

/relative/page

https://www.your.shop/relative/page

https://www.your.shop/relative/page

https://www.fact-finder.de

https://www.fact-finder.de

https://www.fact-finder.de

Demo

Try the Campaign demo.

API code

ff-campaign-advisor

Properties

Properties
Name
Description

name (String) (default: "")

Binds the element to a campaign name defined in the FactFinder backend.

not (String) (default: empty)

Takes a campaign name (as defined in FactFinder backend) as parameter. This element won't trigger for the passed campaign.

Events

Events
Name
Description

dom-updated

This event is triggered when the element has received new data and the template for this element and all sub elements have been punched out.

ff-campaign-advisor-answer

Properties

Properties
Name
Description

answer (Object) (default: empty)

Binds the element to a campaign name defined in the FactFinder backend.

Events

Events
Name
Description

dom-updated

This event is triggered when the element has received new data and the template for this element and all sub elements have been punched out.

ff-campaign-advisor-question

Properties

Properties
Name
Description

question (Object) (default: empty)

The required data from FactFinder.

ff-campaign-feedbacktext

Properties

Properties
Name
Description

label (String) (default: "")

Binds the element to a campaign label defined in the FactFinder backend.

is-product-campaign (Boolean)

If this attribute is present, regardless of its value, the ff-campaign-feedbacktext is only considered for product campaigns retrieved by ff-campaign-product

is-shopping-cart-campaign (Boolean)

If this attribute is present, regardless of its value, the ff-campaign-feedbacktext is only considered for shopping cart campaigns retrieved by ff-campaign-shopping-cart

is-landing-page-campaign (Boolean)

If this attribute is present, regardless of its value, the ff-campaign-feedbacktext is only considered for landing page campaigns retrieved by ff-campaign-landing-page

Events

Events
Name
Description

dom-updated

This event is triggered when the element has received new data and the template for this element and all sub elements have been punched out.

Last updated

Was this helpful?