Skip to main content

Smart FAQ Snippet

Integration​

The installation of the Smart FAQ solution on the customer's site is done by integrating a piece of HTML and a snippet of javascript code within the desired page.

HTML​

Embed the piece of HTML code in the place in your code where the FAQ should appear.

<div id="st-faq"></div>

JS​

Integrate the Javascript snippet just before closing the </body> tag. The Smart Tribune script must be loaded as far downstream as possible in the script loading chain in order to avoid possible conflicts with the scripts present on the client page.

<script type="text/javascript">
window.addEventListener('STFAQLoaded', function (e) {
e.detail.init({
analyticsUA: 'UA-00000000-0',
kbId: 2,
locale: 'en',
cookieOptin: false,
filters: {
thematics: [],
tags: [],
},
});
});
</script>
<script
type="text/javascript"
async
src="https://assets.app.smart-tribune.com/smart-tribune/FAQ/faq.main.js"
></script>

Link to demo : Click here

The integration of the code snippet above is sufficient to allow the partial display of the FAQ within the page. You must also communicate your domain name to your Smart Tribune contact point so that we allow the product to be displayed completely on your environment.

Please note, the link to faq.main.js is a demonstration of the product, the smart-tribune folder in the url will be replaced by the one that will be communicated to you. The url changes completely during the transition from pre-production (public) to production. The complete url is communicated by your Smart Tribune contact point in charge of your account.

info

The domains calling on the specified knowledge base must be declared beforehand directly in the knowledge base configuration in Smart Dashboard by your Account Manager.

Validation environment​

caution

This url differs depending on the environment on which the solution is to be installed at the customer site. It is customary to use PUBLIC for pre-production and to use PRODUCTION for production at the customer site. All this information is communicated by Smart Tribune after the development phase.

PRODUCTION script​

<script
type="text/javascript"
async
src="https://assets.app.smart-tribune.com/smart-tribune/FAQ/faq.main.js"
></script>

PRE-PRODUCTION script​

<script
type="text/javascript"
async
src="https://assets.app.smart-tribune.com/smart-tribune/FAQ/public/faq.main.js"
></script>

Variables list​

VariableTypeConditionExampleDescription
kbIdintrequiredkbId : 2Variable specific to each customer, it corresponds to the identifier (system identifier) of the knowledge base to be used. This is available in Smart Dashboard, the content administration interface. The knowledge base already integrating test content is identified by the value: 2. You can find your kbId on the Dashboard home page in the "Select a knowledge base" then "system identifier" box.
localestringrequiredlocale : "en"It allows the customer to specify in which language the solution should be displayed. This only applies to multilingual knowledge bases.
cookieOptinboolrequiredcookieOptin : falseIt allows you to prevent or not the activation of the Google Analytics cookie (possible value: true or false). By deactivating this functionality, it will no longer be possible to send information in Google Analytics for your FAQ. The default value is false.
analyticsUAstringoptionalanalyticsUA : "UA-00000000-0" or analyticsUA : "G-00000000"It allows the FAQ to sending into your Google Analytics many information about FAQ's users. Compatible with Google Analytics 4.
buildNamestringoptionalbuildName : "design-2"This variable is very usefull if you have a FAQ wich needs color's changing (for example) between a public space and a member space. If necessary for your Smart Tribune product, the value of the variable will be communicated to you after the development phase.
searchFilteredbool/objoptionalsearchFiltered : trueThis variable contextualizes the search with the values of the filters parameter. The default value is true so that the search engine returns only results in the chosen context. Please note that the accessible content remains conditioned by the scope of the solution (FAQ, PUSH, etc.). The value false makes all the contents of the knowledge base accessible in the search engine. To contextualize the search on a different selection of the filters variable, it is possible to add an array of character strings (system identifier of the tag) to specify the new search context (searchFiltered : {"tags: ["TAG"]}).
customVariablesobjoptionalcustomVariables : { brand:"Smart Tribune"}This variable is used to replace the value of a custom variable created in the response content via Smart Dashboard. Note: We expect here a string that can contain HTML tags (span, a, b, u, i, br, img) with its attributes (id, class, style, name, title, target, href, rel, src, alt).
filtersobjoptionalfilters : { thematics:[], tags:[] }This configuration variable allows you to specify the contextualization to apply. It is possible to define the filtering using the thematics system identifier or tags. The operator used is AND in the case of multiple values within the same filter or between filters. If needed, tags can be replaced by tagsOr to use operator OR between tags. Note : These objects contain an array of strings.
headerIdstringoptionalheaderId: "headerTop"This configuration variable allows you to specify the identifier of your horizontal menu. The advantage of this option lies in the fact that it corrects the problems of Scroll when the horizontal menu is in a CSS state: 'position: fixed'. In this state the menu can hide, in certain cases, elements of the FAQ when this one is displayed.
entrypointobjoptionalentrypoint : { type: "question", value: "question-slug" }This configuration variable allows you to display at the loading of Smart FAQ, a question or the questions of a category. To do it, you have to choose the type ('question' or 'thematic') and insert into 'value' the slug of the specified question or thematic.
customResponsesarroptionalcustomResponses : [ "tag" ]This variable allows you to specify the customized response contextualization to apply by using the tag system identifier. Note : This variable is an array of string.

Third-party scripts​

caution

In some cases, you may need to authorize third-party domains as we use scripts external to Smart Tribune for some functionality described below.

Polyfill.io​

Polyfill.io is a service developed by The Financial Times which accepts a request for a set of browser features and returns only the polyfills that are needed by the requesting browser. This is used to ensure compatibility with all browsers up to IE 11.

VersionScript URLDomain to authorize
V3https://polyfill.io/v3/polyfill.min.jspolyfill.io

Google Analytics​

Google Analytics is an analysis tool developed by Google that measures website traffic and collects essential information about website visitors.

VersionScript URLDomain to authorize
V3https://www.google-analytics.com/analytics.jsgoogle-analytics.com
V4https://www.googletagmanager.com/gtag/jsgoogletagmanager.com