Attribute | Type | Description |
---|---|---|
hostProvider | string | The host of the external search, possible values: zendesk |
userId | string or undefined | An optional anonymized user ID, the user ID will be attached to the user actions and will allow improved metrics and traceability |
langCode | string or undefined | An optional language code, will allow Ask-AI to return answers in the specified language. The value should follow ISO format (without region). Allowed values: en / de / fr / es / it / nl |
customStylesId | string or undefined | The ID of the stylesheet import to be included on the style effecting the extenal search bar. List of all the class names can be found here: CSS Customization |
submitRequest | object or undefined | An object that details the submit request action config. If not defined, the user will not see submit request. |
submitRequest.url | string or undefined | The URL to redirect the user when they're clicking on "Submit request" |
submitRequest.questionQueryParamName | string or undefined | Optional, will add the question the user asked as a query param in the provided key |
Example
<!-- Import custom styles -->
<style id="ask-ai-custom">.ask-ai-external-search-search-bar { background: green; }</style>
<!-- Import external search artifacts -->
<script type="text/javascript" src="https://external-search.ask-ai.co/ask_ai_sb.js"></script>
<!-- Render external search -->
<script type="text/javascript">
window.renderAskAISearchBar("SELECTOR", "TOKEN", {
hostProvider: "zendesk",
langCode: "en",
customStylesId: "ask-ai-custom",
submitRequest: {
// Will redirect to the URL with the question as a query parameter, for example, for question: "What is Ask-AI?" the user will be redirected to "https://www.ask-ai.com/request-demo?question=What%20is%20Ask-AI%3F"
url: "https://www.ask-ai.com/request-demo",
questionQueryParamName: "question",
},
});
</script>