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}}.
<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.
Adding Advisor campaigns
To integrate advisor campaigns, you need the following elements:
ff-campaign-advisorff-campaign-advisor-questionff-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.
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:
Demo
Try the Campaign demo.
API code
ff-campaign-advisor
Properties
Events
ff-campaign-advisor-answer
Properties
Events
ff-campaign-advisor-question
Properties
ff-campaign-feedbacktext
Properties
Events
Last updated
Was this helpful?